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();
        }
Exemplo n.º 2
0
 public bool SaveAll()
 {
     return(_ctx.SaveChanges() > 0);
 }