I'm using the Entity Framework as my ORM and I'm using a Repository of repositories (?) to abstract the EF so I can mock out etc and test etc.
A single repo.
public interface IRepository<T> : IView<T>
{
IQueryable<T> GetAll();
void Update( T entity );
void Delete( T entity );
void Add(T entity);
T Default();
}
the repo of repo's ;)
public interface IRepoOfRepos
{
IRepository<Table_a> Table_as { get; }
IRepository<Table_b> Table_bs { get; }
IRepository<Table_c> Table_cs { get; }
etc etc
In our application we have a series of 'modules' that perform discrete chunks of business logic and I was planning on 'injecting' the 'IRepoOfRepos' into each.
However, another team member has suggested that we should really be creating an additional layer (interface) with only the data access methods needed by each module (aka the 'I' in SOLID).
We have quite a large number of modules (30+) and this seems like quite a lot of extra work for a principle that I feel may not apply to the Data Access Layer and is really aimed at the Business Layer?
Your thoughts are much appreciated and thanks in advance!