public static void ShowCoffees() { Console.WriteLine("Coffees"); Console.WriteLine("=========================================================================="); foreach (var coffee in coffeeRepo.GetAll()) { Console.WriteLine($"Id: {coffee.Id}, Name: {coffee.Name}, Price: {coffee.Price}, WaterPortion: {coffee.WaterPortion}" + $", SugarPortion: {coffee.SugarPortion}, CoffeePortion: {coffee.CoffeePortion}"); Console.Write("--------------------------------------------------------------------------------"); } Console.WriteLine("=========================================================================="); }
public List <CoffeeBll> Filter(CoffeeSortBll sort, Guid countryId) { return(coffeeRepository.GetAll().Where(c => c.CoffeeSortId == (int)sort && c.Country.Id == countryId) .Select(CoffeeMapper.Map).ToList()); }
public IActionResult Get() { return(Ok(_coffeeRepository.GetAll())); }
public IActionResult Get() { // Ok = 200 OK Response with data in body return(Ok(_coffeeRepository.GetAll())); }
public IActionResult Get() { //Ok() is used when we want to return data return(Ok(_coffeeRepository.GetAll())); }
public async Task <IEnumerable <Coffee> > Handle(RetrieveAllCoffeesCommand request, CancellationToken cancellationToken) => await _coffeeRepository.GetAll(cancellationToken);
public IEnumerable <Coffee> GetAllCoffees() { return(_coffeeRepository.GetAll()); }