예제 #1
0
 public Book(Guid id, Guid customerId, Guid productId, int reserveDaysCount)
 {
     CustomValidator.ValidateNumber(reserveDaysCount, 1, 7);
     CustomValidator.ValidateId(id);
     CustomValidator.ValidateId(customerId);
     CustomValidator.ValidateId(productId);
     Id               = id;
     CustomerId       = customerId;
     ProductId        = productId;
     CreationTime     = DateTimeOffset.UtcNow;
     ExpirationTime   = CreationTime.AddDays(reserveDaysCount);
     ReserveDaysCount = reserveDaysCount;
 }
예제 #2
0
 public bool IsValid() => CreationTime.AddDays(1d).CompareTo(DateTime.Now) > 0;