public void Run() { var horses = _horseService.GetAllHorses(); foreach (var horse in horses) { Console.WriteLine($"HorseName: {horse.Name}, Price:{horse.Price}"); } Console.WriteLine("Enter any key to exit"); Console.Read(); }
public IActionResult GetAllHorses(HorseRequest horseRequest) { _mainResponse = _horseService.GetAllHorses(horseRequest); _jsonString = Mapper.Convert <GetAllHorses>(_mainResponse); return(new OkObjectResult(_jsonString)); }