Exemple #1
0
        public async Task <IActionResult> GetDashModel()
        {
            DashboardModel dashboardModel = new DashboardModel();
            var            ListSales      = _context.GetSales();

            dashboardModel.SalesCount = ListSales.Result.Count;
            dashboardModel.Money      = ListSales.Result.Sum(t => t.Total);
            return(Ok(dashboardModel));
        }
Exemple #2
0
 public async Task <IActionResult> GetAllSales()
 {
     return(Ok(await _context.GetSales()));
 }