I don't know if the following is weird but actually need an interface for an interface< T > in order to store it in a List without specify a specific implementation.
Example:
public interface IRepository<T>
{
void Add(T newEntity);
void Remove(T entity);
IEnumerable<T> FindAll();
IEnumerable<T> Find(Expression<Func<T, bool>> predicate);
}
public interface IUnitOfWork
{
//Here i would like to store just a IRepository without implementation
IList<IRepository<**I have to specify implementation here**>> Repositories { get; set; }
bool Commit();
}
You are free to suggest me better ways to do that. This is only what i have though to do...
Thanks
EDIT
I cannot provide a non-generic interface because i'm using it like this:
public class GenericRepository<T> : IRepository<T>
{
...generic repository methods...
}
//Specific repository...
public class MyTableClassRepository<MyTable> : GenericRepository<MyTable>
{
public MyTableClassRepository(Database context) : base(context)
{
}
}