Exemplo n.º 1
0
 public ActionResult <IEnumerable <Pet> > Get([FromQuery] Filter filter)
 {
     if (filter.CurrentPage == 0 && filter.ItemsPrPage == 0)
     {
         return(Ok(_petService.GetAllPets()));
     }
     return(Ok(_petService.GetFilteredPets(filter)));
 }
Exemplo n.º 2
0
        private void PrintPetList()
        {
            Console.Clear();
            Console.WriteLine("You have chosen option 1 - print all pets:");
            Console.WriteLine("------------------------------------------------------------------------");
            Console.WriteLine("");
            Console.WriteLine($"There are now {FakeDb.Pets.Count} pets on your list.");
            Console.WriteLine("");
            var pets = _petShopService.GetAllPets();

            PrintAllPets(pets);
        }
Exemplo n.º 3
0
 public ActionResult <IEnumerable <Pet> > Get()
 {
     return(_petShopService.GetAllPets().ToList());
 }