예제 #1
0
파일: Account.cs 프로젝트: zongu/BankWork
        public bool Deposit(long points)
        {
            if (TotalPoints() + points < 0)
            {
                return(false);
            }

            DepositRecords.Add(new DepositRecord()
            {
                Points         = points,
                CreateDateTime = DateTime.Now
            });

            return(true);
        }
예제 #2
0
파일: Account.cs 프로젝트: zongu/BankWork
 public long TotalPoints()
 => DepositRecords.Sum(p => p.Points);