コード例 #1
0
ファイル: Spending.cs プロジェクト: FoxSilou/Spending
        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);
        }
コード例 #2
0
ファイル: Spending.cs プロジェクト: FoxSilou/Spending
 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));
 }