public void Setup() { if (!_environment.IsDevelopment()) { throw new System.Exception("Cannot seed a dev database in a non-development environmetn"); } _context.Database.Migrate(); if (_context.User.All(u => u.Id != 1)) { _context.Add(new User { Username = "******", Password = "******" /*Password1*/ }); } _context.SaveChanges(); }