Example #1
0
        public static decimal CashFlowAmountForMonth(this Budget budget, int year, int month)
        {
            var startDate = new DateTime(year, month, 1);
            var endDate   = startDate.AddMonths(1).AddDays(-1);

            return(budget.DailyCashFlowsBetween(startDate, endDate)
                   .SelectMany(x => x)
                   .Sum(x => x.Amount));
        }
Example #2
0
 public static decimal CashFlowAmountBetween(this Budget budget, DateTime startDate, DateTime endDate)
 {
     return(budget.DailyCashFlowsBetween(startDate, endDate)
            .SelectMany(x => x)
            .Sum(x => x.Amount));
 }