public Borrowing(int id, Magazine magazine, Friend friend, DateTime borrowingDate) { if (!IsValidMagazine(magazine)) { throw new ArgumentException("Magazine property cannot be set instantiated as a null value."); } if (!isValidFriend(friend)) { throw new ArgumentException("Friend property cannot be set instantiated as a null value."); } if (!IsValidDateTime(borrowingDate)) { throw new ArgumentException("BorrowingDate property cannot be set as a date from the future."); } this.id = id; this.magazine = magazine; this.friend = friend; this.borrowingDate = borrowingDate; }
private bool IsValidMagazine(Magazine magazine) { return(magazine != null); }