public RentsController(Car_Rental_DBContext context)
 {
     _context = context;
 }
Exemple #2
0
 public UsersCarsController(Car_Rental_DBContext context)
 {
     _context = context;
 }
Exemple #3
0
        // 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?}");
            });
        }
Exemple #4
0
 public BookingsController(Car_Rental_DBContext context)
 {
     _context = context;
 }
Exemple #5
0
 public DriversController(Car_Rental_DBContext context)
 {
     _context = context;
 }