Exemplo n.º 1
0
        public IEnumerable <FoodOrder> Get()
        {
            string   userJWTId = User.FindFirst("id")?.Value;
            Customer customer  = dbFoodOrder.GetCustomer(userJWTId);

            if (customer == null)
            {
                return(dbFoodOrder.GetEntityList());
            }
            List <FoodOrder> foodOrder = dbFoodOrder
                                         .GetFoodOrderByCustomer(customer.Id).ToList();

            for (int i = 0; i < foodOrder.Count(); i++)
            {
                foodOrder[i].Customer = null;
            }
            return(foodOrder.AsEnumerable());
        }