public ValuesController(MotherloadContext motherload) { this.motherload = motherload; if (motherload.Users.Count() == 0) { // Create a new User if collection is empty, // which means you can't delete all People. motherload.Users.Add(new User { Name = "Mihail Kanchev", Password = "******", Email = "*****@*****.**", PhoneNumber = "69696969" }); motherload.SaveChanges(); } }
public UsersController(MotherloadContext motherload) { this.motherload = motherload; if (motherload.Users.Count() == 0) { // Create a new User if collection is empty, // which means you can't delete all People. motherload.Users.Add(new User { Name = "Admin", Password = "******", Email = "admin", PhoneNumber = "admin" }); motherload.SaveChanges(); } }
public RidesController(MotherloadContext motherload) { this.motherload = motherload; }