I am trying to grasp specification pattern and i get confused a little about it. I really couldn't found it helpful for my specific requirements. I want to know that what is problem if i prefer extension methods for my complex spesifications? For example
public static class ProductExtensions
{
public static IQueryable<Product> InStocks(this IQueryable<Product> query)
{
return query.Where(p => p.InStock && !p.IsDeleted /*others goes here*/);
}
}
I found it helpful to wrap my long specifications with an extension methods instead of using spesification pattern. What is wrong with this ?