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); }
public IEnumerable <OrderHistoryDataModel> GetHistory() { var history = coffeeService.GetHistory(); return(history); }
public IEnumerable <OrderHistoryDataModel> Get() { return(_service.GetHistory()); }