示例#1
0
        /// <summary>
        /// Default constructor assigning new <see cref="Guid"/> becuase entity live also un-persisted.
        /// </summary>
        public Rental(Book book, string rentee) {
            AssertUtils.IsTrue(book != null);
            AssertUtils.IsTrue(rentee != null);

            Id = new Guid();
            Book = book;
            Rentee = rentee;
            StartOfRental = DateTime.UtcNow;
        }
示例#2
0
 public void AddBook(Book book) {
     books.Add(book);
 }