コード例 #1
0
        public ICollection <BudgetDTO> GetBudgetByAppUserId(string userName)
        {
            var budgets = (from b in _repo.GetBudgetByAppUserId(userName)
                           select new BudgetDTO
            {
                Id = b.Id,
                Name = b.Name,
                Amount = b.Amount,
                Current = b.Current,
                AppUserDTO = new ApplicationUserDTO
                {
                    Id = b.AppUser.Id,
                    MonthlyIncome = b.AppUser.MonthlyIncome,
                    CurrentTotal = b.AppUser.CurrentTotal,
                    Spent = b.AppUser.Spent
                }
            }).ToList();

            return(budgets);
        }