Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public class Balance
  2. {
  3. public Balance(decimal amount, DateTime asOf)
  4. {
  5. Amount = amount;
  6. AsOf = asOf;
  7. }
  8.  
  9. public decimal Amount { get; private set; }
  10. public DateTime AsOf { get;private set; }
  11.  
  12. public void Add(decimal value)
  13. {
  14. AsOf = DateTime.UtcNow;
  15. Amount += value;
  16. }
  17.  
  18. public void Subtract(decimal value)
  19. {
  20. AsOf = DateTime.UtcNow;
  21. Amount -= value;
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement