public RentsController(Car_Rental_DBContext context) { _context = context; }
public UsersCarsController(Car_Rental_DBContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ApplicationDbContext application, Car_Rental_DBContext car, UserManager <ApplicationUser> userManager) { List <ApplicationUser> list = application.Users.ToList(); List <Users> list2 = car.Users.ToList(); foreach (var u in list2) { if (!list.Exists(x => x.Email == u.Login)) { var user = new ApplicationUser { UserName = u.Login, Email = u.Login, PhoneNumber = u.PhoneNumber.ToString() }; var result = userManager.CreateAsync(user, u.Password); } } if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=UsersCars}/{action=Index}/{id?}"); }); }
public BookingsController(Car_Rental_DBContext context) { _context = context; }
public DriversController(Car_Rental_DBContext context) { _context = context; }