Esempio n. 1
0
        public IActionResult BudgetVersusActual()
        {
            List <YearlyBudgetInfo> result = _loanRepository.AllLoansGroupedByProductGroupsInquire();

            if (result == null)
            {
                return(NotFound());
            }


            Dictionary <string, YearlyBudgetInfoDto> dataToReturn = new Dictionary <string, YearlyBudgetInfoDto>();

            foreach (YearlyBudgetInfo info in result)
            {
                dataToReturn.Add(info.ProductGroupTitle, new YearlyBudgetInfoDto()
                {
                    ActualBudget = info.ActualBudget, YearlyBudget = info.YearlyBudget
                });
            }

            return(Ok(dataToReturn));
        }