Beispiel #1
0
        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("==========================================================================");
        }
Beispiel #2
0
 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());
 }
Beispiel #3
0
 public IActionResult Get()
 {
     return(Ok(_coffeeRepository.GetAll()));
 }
Beispiel #4
0
 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());
 }