Ejemplo n.º 1
0
        public BudgetedAmount AddBudgetedAmount(MoneyAmount amount, DateTime validFrom)
        {
            var budgetedAmount = BudgetedAmount.Create(this, amount, validFrom);

            if (BudgetedAmounts.Any(x => x.ValidFrom == budgetedAmount.ValidFrom))
            {
                throw new BusinessException("Another budgeted amount starting at same date");
            }

            BudgetedAmounts.Add(budgetedAmount);
            return(budgetedAmount);
        }