// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, EfCoreSampleDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); app.EnsureContextMigrated <EfCoreSampleDbContext>(); //TODO change this seed method, remove EfCoreSampleDbContext from configure method SeedDb.Initialize(context);//ContextSeed.SeedAsync(app).Wait(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, EfCoreSampleDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("./swagger/v1/swagger.json", "My API V1"); c.RoutePrefix = string.Empty; }); app.UseMvc(); app.EnsureContextMigrated <EfCoreSampleDbContext>(); SeedDb.Initialize(context); }
public ProjectRepository(EfCoreSampleDbContext context) { _context = context; }
public PostService(EfCoreSampleDbContext dataContext) { _dataContext = dataContext; }