I am getting this error message which when trying to inherit from my GenericRepository. The error says I need to also provide a context but I am not sure how?
//IncidentRepository
public class IncidentRepository : GenericRepository<Incident>
//Generic Repository (to inherit from)
public class GenericRepository<TEntity> where TEntity : class
{
internal db_SLee_FYPContext context;
internal DbSet<TEntity> dbSet;
public GenericRepository(db_SLee_FYPContext context)
{
this.context = context;
this.dbSet = context.Set<TEntity>();
}
EDIT:
Just to check I've grasped this?
public class IncidentRepository: GenericRepository<Incident>
{
public IncidentRepository(db_SLee_FYPContext context)
{
this.context = context;
}
//Then in my genric repository
public GenericRepository()
{
}