Esempio n. 1
0
        public void GetAll_Returns_3_Dogs()
        {
            var underTest = new DogRepository();
            var result    = underTest.GetAll();

            Assert.Equal(3, result.Count);
        }
Esempio n. 2
0
        public ActionResult <IEnumerable <Pet> > GetAll()
        {
            IDogRepository dogRepository = new DogRepository();
            var            dogs          = dogRepository.GetAll();

            return(Ok(dogs));
        }
Esempio n. 3
0
        public IActionResult Get()
        {
            var dogs = dogRepository.GetAll().Select(dog => new ApiDog {
                Id   = dog.Id,
                Name = dog.Name
            });

            return(Ok(dogs)); // "OkResult" - 200 OK, with response body (automatically serialized).
        }
Esempio n. 4
0
        public async Task <IActionResult> Index()
        {
            if (PasswordHash.userauth == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            IEnumerable <Shelter> shelters = await _shelterRepo.GetAll();

            IEnumerable <Dog> dogs = await _dogRepo.GetAll();

            ViewBag.userTypes = await _userTypeRepo.GetAll();

            DisplayData displayData = new DisplayData
            {
                Shelters  = shelters,
                Dogs      = dogs,
                City      = "Salt Lake City",
                StateCode = "UT"
            };

            return(View(displayData));
        }
Esempio n. 5
0
        public async Task <IActionResult> Doggos()
        {
            IEnumerable <Dog> dogs = await _dogRepo.GetAll();

            return(View(dogs));
        }
Esempio n. 6
0
        public IActionResult Index()
        {
            var dogs = _repository.GetAll();

            return(View(dogs));
        }