Hi, how can my UoF interface inherit from IRepository? having this:
public interface IRepository<T> where T : class, IDisposable
IoW
public interface IUnitOfWork : IRepository
{
int Save();
}
Hi, how can my UoF interface inherit from IRepository? having this:
public interface IRepository<T> where T : class, IDisposable
IoW
public interface IUnitOfWork : IRepository
{
int Save();
}
You could define the T
of generic also in the class UoW
public interface IRepository<T> : IDisposable where T : class
{
}
public interface IUnitOfWork<T> : IRepository<T> where T : class
{
int Save(T entity);
}
I would also recommend you analyze examples like being
Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)
in the title Creating the Unit of Work Class you could see that the UoW class does not inherit from any repository