Esempio n. 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new MvcUserContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <MvcUserContext> >()))
            {
                // Look for any Users.
                if (context.User.Any())
                {
                    return;   // DB has been seeded
                }

                context.User.AddRange(
                    new User
                {
                    username     = "******",
                    password     = "",
                    name         = "Carlos",
                    surename     = "Díaz",
                    email        = "*****@*****.**",
                    phone        = "662316747",
                    model        = "Opel Corsa",
                    licensePlate = "123456XYZ",
                    image        = "",
                }
                    );
                context.SaveChanges();
            }
        }
Esempio n. 2
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new MvcUserContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <MvcUserContext> >()))
            {
                // Look for any movies.
                if (context.User.Any())
                {
                    return;   // DB has been seeded
                }

                context.SaveChanges();
            }
        }
Esempio n. 3
0
 public MockupsController(MvcUserContext context)
 {
     db = context;
 }
 public ClientController(MvcUserContext context)
 {
     _context = context;
 }
Esempio n. 5
0
 public UsersController(MvcUserContext context)
 {
     _context = context;
 }
Esempio n. 6
0
 public HomeController(MvcUserContext context)
 {
     db = context;
 }