Exemple #1
0
        /// <summary>
        /// Default constructor assigning new <see cref="Guid"/> becuase entity live also un-persisted.
        /// </summary>
        public Book(Library library, string isbn) {
            AssertUtils.IsTrue(!string.IsNullOrEmpty(isbn));
            AssertUtils.IsTrue(library != null, "Library is mandatory for book construction.");

            Id = Guid.NewGuid();
            Isbn = isbn;
            Library = library;
            library.AddBook(this);
        }