public void GetAll_Returns_3_Dogs() { var underTest = new DogRepository(); var result = underTest.GetAll(); Assert.Equal(3, result.Count); }
public ActionResult <IEnumerable <Pet> > GetAll() { IDogRepository dogRepository = new DogRepository(); var dogs = dogRepository.GetAll(); return(Ok(dogs)); }
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). }
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)); }
public async Task <IActionResult> Doggos() { IEnumerable <Dog> dogs = await _dogRepo.GetAll(); return(View(dogs)); }
public IActionResult Index() { var dogs = _repository.GetAll(); return(View(dogs)); }