// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AbcSchoolDbContext dbContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/error"); } dbContext.Database.EnsureCreated(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public UnitOfWork(AbcSchoolDbContext context, StudentRepository studentRepository, SubjectRepository subjectRepository) { _context = context; StudentRepository = studentRepository; SubjectRepository = subjectRepository; }
// student specific stuff public StudentsRepo(AbcSchoolDbContext context) : base(context) { }
public SubjectRepository(AbcSchoolDbContext context) : base(context) { _context = context; }
public StudentRepository(AbcSchoolDbContext context) : base(context) { _context = context; }
public BaseRepository(AbcSchoolDbContext context) { this.context = context; this.dbSet = context.Set <T>(); }
// student specific stuff public SubjectsRepo(AbcSchoolDbContext context) : base(context) { }
protected GenericRepository(AbcSchoolDbContext context) { this.Context = context; }