public UsersController(PetDBContext context, AnimalsController animalsController) { _context = context; _animalsController = animalsController; if (_context.Users.Count() == 0) { User newUser = new User { Name = "Noah the Zookeeper" }; _context.Users.Add(newUser); _context.SaveChanges(); // Add one animal to the user AddAnimalToUser(newUser.Id); } }
public SqlServerPetDbService(PetDBContext context) { _dbcontext = context; }
public AnimalsController(PetDBContext context) { _context = context; }
public PetController(PetDBContext context) { _dbcontext = context; }