Exemplo n.º 1
0
 // 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();
 }
Exemplo n.º 2
0
        // 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);
        }
Exemplo n.º 3
0
 public ProjectRepository(EfCoreSampleDbContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public PostService(EfCoreSampleDbContext dataContext)
 {
     _dataContext = dataContext;
 }