public Spending SetSpender(Spender spender = null) { if (Currency != null && Currency.Id != spender?.Currency?.Id) { throw new ValidationException("Spending.SetSpender: Spender is not valid"); } Spender = spender; return(this); }
public static Spending BuildSpending( long?id = null, Spender spender = null, DateTime?date = null, SpendingNature nature = SpendingNature.Misc, decimal?amount = null, Currency currency = null, string comment = null) { return(new Spending() .SetId(id) .SetSpender(spender) .SetSpendingDate(date) .SetNature(nature) .SetAmount(amount) .SetCurrency(currency) .SetComment(comment)); }