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; }
public bool IsValid() => CreationTime.AddDays(1d).CompareTo(DateTime.Now) > 0;