public ApplicationDataLoader( IFacilityService facilityService, IWorldService worldService, IZoneService zoneService, IDbSeeder dbSeeder, ILogger <ApplicationDataLoader> logger) { _facilityService = facilityService; _worldService = worldService; _zoneService = zoneService; _dbSeeder = dbSeeder; _logger = logger; }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDbSeeder seeder) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseAuthentication(); app.UseMvcWithDefaultRoute(); seeder.Seed(); }
public ApplicationDataLoader( IItemCategoryService itemCategoryService, IScrimRulesetManager rulesetManager, IScrimMatchScorer matchScorer, IFacilityService facilityService, IWorldService worldService, IZoneService zoneService, IDbSeeder dbSeeder, ILogger <ApplicationDataLoader> logger) { _itemCategoryService = itemCategoryService; _rulesetManager = rulesetManager; _matchScorer = matchScorer; _facilityService = facilityService; _worldService = worldService; _zoneService = zoneService; _dbSeeder = dbSeeder; _logger = logger; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { using (var scope = app.ApplicationServices.CreateScope()) { // Initialize the database var services = scope.ServiceProvider; PetShopAppContext ctx = services.GetService <PetShopAppContext>(); IDbSeeder seeder = services.GetService <IDbSeeder>(); seeder.Seed(ctx); app.UseDeveloperExceptionPage(); } } else { using (var scope = app.ApplicationServices.CreateScope()) { // Initialize the database var services = scope.ServiceProvider; PetShopAppContext ctx = services.GetService <PetShopAppContext>(); IDbSeeder seeder = services.GetService <IDbSeeder>(); seeder.Seed(ctx); seeder.Seed(ctx); app.UseHsts(); } } //app.UseHttpsRedirection(); // Enable CORS (must precede app.UseMvc()): app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); // Use authentication app.UseAuthentication(); app.UseMvc(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IDbSeeder dbSeeder) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); dbSeeder.Seed(); } if (env.IsProduction()) { app.UseHttpsRedirection(); } // global cors policy app.UseCors( x => x.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseResponseCompression(); app.UseRouting(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Wealth Manager API V1"); }); app.UseAuthentication(); app.UseAuthorization(); app.UseMiddleware <ExceptionHandleMiddleware>(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IDbSeeder seeder, IServiceProvider serviceProvider) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MzE5MzQ4QDMxMzgyZTMyMmUzMEI2L0VJSnNCS1ZaaUh1WjUyditEWUsvMzZHaDJmc1IzQTBKZkxaTGM2Vzg9"); seeder.Seed(env.IsDevelopment()); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); GlobalConfiguration.Configuration.UseActivator(new CustomJobActivator(serviceProvider)); app.UseHangfireDashboard("/jobs"); app.UseHangfireServer(); RecurringJob.AddOrUpdate <IEmailAvailableShiftService>(x => x.SendNotifications(), Cron.Weekly(DayOfWeek.Saturday)); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllers(); }); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceStarter starter, IDbSeeder seeder) { loggerFactory.AddDebug(); loggerFactory.AddSerilog(); app.UseExceptionHandler(options => { options.Run( async context => { context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; var ex = context.Features.Get <IExceptionHandlerFeature>(); if (ex != null) { var err = $"Error: {ex.Error.Message}{ex.Error.StackTrace}"; Log.Error(ex.Error, "Server Error", ex); await context.Response.WriteAsync(err).ConfigureAwait(false); } }); }); app.UseCors("CorsPolicy"); seeder.Seed(Configuration.GetSection("AppSettings:ConnectionString").Value); starter.Start(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); app.UseAuthentication(); app.UseStatusCodePages(); app.UseStaticFiles(); app.UseDefaultFiles(); app.UseMvc(); }
public AccountController(UserManager <UserEntity> userManager, IDbSeeder seeder) { _userManager = userManager; _seeder = seeder; }
public PositionsController(IPositionService positionService, IDbSeeder seeder) { _positionService = positionService; _seeder = seeder; }
public UsersController(IUserService userService, IWebHostEnvironment env, IDbSeeder seeder) { _userService = userService; _env = env; _seederService = seeder; }
public DataGeneratorController(IDbSeeder DbSeeder) { _DbSeeder = DbSeeder; }
public BooksController(ApplicationDbContext context, IDbSeeder <ApplicationDbContext> seeder) { _context = context; _seeder = seeder; }
public TimesheetController(ITimesheetService tsService, IDbSeeder dbSeeder) { _tsService = tsService; _dbSeeder = dbSeeder; }
public TeamsController(ITeamService memberService, IWebHostEnvironment env, IDbSeeder seeder) { _teamService = memberService; _env = env; _seederService = seeder; }
public DbSeederHostedService(IDbSeeder service) { _service = service; }