Я получаю это сообщение об ошибке, которое при попытке наследовать от моего GenericRepository. Ошибка говорит, что мне нужно также предоставить контекст, но я не уверен, как это сделать?
//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>();
}
ИЗМЕНИТЬ:
Просто, чтобы проверить, понял ли я это?
public class IncidentRepository: GenericRepository<Incident>
{
public IncidentRepository(db_SLee_FYPContext context)
{
this.context = context;
}
//Then in my genric repository
public GenericRepository()
{
}