Example #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, JustInTimeCompanyDbContext context, UserManager <AppUser> userManager, RoleManager <IdentityRole> roleManager)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            JustInTimeCompanyInitializer.Initiliaze(context, userManager, roleManager);

            app.UseStaticFiles(new StaticFileOptions {
                OnPrepareResponse = ctx =>
                {
                    const int duration = 60 * 60 * 24;
                    ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public, max-age=" + duration;
                }
            });

            app.UseAuthentication();
            app.UseMvc(routes => routes.MapRoute(name: "Default", template: "{controller=Home}/{action=Index}/{id?}"));
        }
Example #2
0
 public UserRepository(UserManager <AppUser> userManager, SignInManager <AppUser> signInManager, JustInTimeCompanyDbContext dbContext)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _dbContext     = dbContext;
 }
Example #3
0
 public FlightRepository(JustInTimeCompanyDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public PlaneRepository(JustInTimeCompanyDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #5
0
 public AirportRepository(JustInTimeCompanyDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #6
0
 public BookingRepository(JustInTimeCompanyDbContext dbContext)
 {
     _dbContext = dbContext;
 }