// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, RemindMealContext context) { Console.WriteLine($"Startup: Environment is {env.EnvironmentName}"); if (env.IsDevelopment()) { Console.WriteLine("Using Developer Page and DB error page"); app.UseDeveloperExceptionPage(); app.UseMigrationsEndPoint(); } else { var db = app.ApplicationServices.GetRequiredService <RemindMealContext>(); db.Database.Migrate(); app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseRouting(); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); }
public DeleteModel(RemindMealContext context) { _context = context; }
public CreateModel(RemindMealContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public IndexModel(RemindMealContext context) { _context = context; }
public User GetCurrentSessionUser(RemindMealContext context) => _user;
public User GetCurrentSessionUser(RemindMealContext context) { string userName = _httpContextAccessor.HttpContext.User?.Identity?.Name; return(context.Users.SingleOrDefault(user => user.UserName == userName)); }
public DetailsModel(RemindMealContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public IndexModel(RemindMealContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
public DetailsModel(RemindMealContext context) { _context = context; }
public EditModel(RemindMealContext context) { _context = context; }
public EditModel(RemindMealContext context, IMapper mapper) { _context = context; this.mapper = mapper; }