public GenericRepository(PostApplicationContext context) { if (context == null) { return; } _context = context; _dbSet = _context.Set <TEntity>(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PostApplicationContext context) { app.UseCors("CorsPolicy"); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); SeedData.SeedDatabase(context); }
public UnitOfWork(PostApplicationContext dbContext) { this.dbContext = dbContext; }
public UserRepository(PostApplicationContext context) : base(context) { this.context = context; }