Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public SqlServerPetDbService(PetDBContext context)
 {
     _dbcontext = context;
 }
Esempio n. 3
0
 public AnimalsController(PetDBContext context)
 {
     _context = context;
 }
Esempio n. 4
0
 public PetController(PetDBContext context)
 {
     _dbcontext = context;
 }