public PromotionController(ILogger <PromotionController> logger, [FromServices] EnvReader envReader, [FromServices] PromotionData promotionData, ZhaoContext context) { _logger = logger; _envReader = envReader; _promotionData = promotionData; _context = context; }
public ReservationController(ILogger <ReservationController> logger, [FromServices] EnvReader envReader, [FromServices] ReservationData reservationData, [FromServices] EmailService emailService, ZhaoContext context, UserManager <IdentityUser> userManager) { _logger = logger; _envReader = envReader; _reservationData = reservationData; _emailService = emailService; _context = context; _userManager = userManager; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider services) { ZhaoContext context = services.GetRequiredService <ZhaoContext>(); DbInitializer.Initialize(context); CreateRoles(services).Wait(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/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(); } // app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseSession(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapRazorPages(); }); UpdateDatabase(app); }
public ReservationsController(ZhaoContext context, IAuthorizationService authService) { _context = context; _authServ = authService; }
public PromotionsController(ZhaoContext context) { _context = context; }