Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1.     public class Payment : ValueObject
  2.     {
  3.         public DateTime PaymentDate { get; private set; }
  4.         public PaymentType PaymentType { get; private set; }
  5.  
  6.         public static Payment CreateMoney(DateTime paymentDate)
  7.         {
  8.             return new Payment
  9.                    {
  10.                        PaymentType = PaymentType.MoneyPayment,
  11.                        PaymentDate = paymentDate
  12.                    };
  13.         }
  14.  
  15.         public static Payment CreateFree(DateTime paymentDate)
  16.         {
  17.             return new Payment
  18.                    {
  19.                        PaymentType = PaymentType.FreePayment,
  20.                        PaymentDate = paymentDate
  21.                    };
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement