コード例 #1
0
        public static AmountRecord Load(Guid?id, string description, Amount amount)
        {
            AmountRecord amountRecord = new AmountRecord();

            amountRecord.Id          = id ?? Guid.NewGuid();
            amountRecord.Description = description;
            amountRecord.Amount      = amount;
            return(amountRecord);
        }
コード例 #2
0
        public AmountRecord Remove(Guid id)
        {
            AmountRecord amountRecord = Get(id);
            bool         removed      = _amountRecords.Remove(amountRecord);

            if (removed)
            {
                return(amountRecord);
            }

            return(default);
コード例 #3
0
 public void Add(AmountRecord amount)
 {
     _amountRecords.Add(amount);
 }
コード例 #4
0
        public void Add(Amount amount, string description = null)
        {
            AmountRecord record = new AmountRecord(amount, description);

            _amountRecords.Add(record);
        }