public static void Seed(UserAdminContext context)
        {
            if (context.Users.Any())
            {
                return;
            }
            var users = new User[]
            {
                new User {
                    Mail = "*****@*****.**", Users = "Carson", Password = "******", Status = true, Sex = "Male"
                },
                new User {
                    Mail = "*****@*****.**", Users = "Peter", Password = "******", Status = true, Sex = "Male"
                }
            };

            foreach (User u in users)
            {
                context.Users.Add(u);
            }
            context.SaveChanges();
        }
Esempio n. 2
0
 public UserAdminRepository(UserAdminContext ctx)
 {
     _ctx = ctx;
 }
 public UserAdminSeeder(UserAdminContext ctx)
 {
     _ctx = ctx;
 }