It seems that every example I find of the repository pattern, the implementation is different in some way. The following are the two examples I mainly find.
interface IProductRepository
{
IQueryable<Product> FindAll();
}
There is then usually another layer which talks to the repository and calls the FindAll() method and performs any operations such as finding products beginning with the letter 's' or fetching products in a particular category.
The other example I find a lot put all of the find methods into the repository
interface IProductRepository
{
IEnumerable<Product> GetProductsInCategory(int categoryId);
IEnumerable<Product> GetProductsStartingWith(string letter);
IEnumerable<PromoCode> GetProductPromoCodes(int productId);
}
Which path do you recommend I take? Or what are the advantages/disadvantages from each other?
From my understanding having read http://martinfowler.com/eaaCatalog/repository.html the first approach seems to best reflect this?