Example #1
0
        public IEnumerable <OrderHistoryGraphModel> Get()
        {
            var orderHistories = _service.GetHistory();
            IEnumerable <OrderHistoryGraphModel> chartData = new List <OrderHistoryGraphModel>();

            chartData = orderHistories
                        .GroupBy(l => l.RecipeId)
                        .Select(cl => new OrderHistoryGraphModel
            {
                Name     = cl.First().Recipe.Name,
                Quantity = cl.Sum(c => c.Quantity)
            }).ToList();

            return(chartData);
        }
Example #2
0
        public IEnumerable <OrderHistoryDataModel> GetHistory()
        {
            var history = coffeeService.GetHistory();

            return(history);
        }
Example #3
0
 public IEnumerable <OrderHistoryDataModel> Get()
 {
     return(_service.GetHistory());
 }