public IActionResult Get()
 {
     try
     {
         return(Ok(_drinkBLL.List().Select(d => JsonSerializer.Serialize <DrinkDTO>(d))));
     }
     catch
     {
         return(StatusCode(500));
     }
 }
Ejemplo n.º 2
0
        public void Save_NoBadge_Test()
        {
            DrinkBLL        drinkBll  = new DrinkBLL();
            List <DrinkDTO> drinkList = drinkBll.List();
            DrinkDTO        drink     = drinkList?.FirstOrDefault(d => d.Code.Equals("COF"));

            Assert.IsNotNull(drink);

            OrderDTO order = new OrderDTO
            {
                Drink      = drink,
                SugarLevel = 2,
                HasOwnMug  = true,
                Badge      = null
            };

            OrderBLL bll = new OrderBLL();

            bll.Save(order);
        }