示例#1
0
        public static Book Create(string title, string description, AuthorId authorId, AuthorFullName authorName)
        {
            var book = new Book(
                TypedId.GetNewId <BookId>(), title, description, authorId, authorName);

            book.AddEvent(new BookCreated((BookId)book.Id, title, description, authorId));
            return(book);
        }
示例#2
0
        public static LibraryRecord Create(UserRecord user, List <BookRecord> books)
        {
            var record = new LibraryRecord(TypedId.GetNewId <LibraryRecordId>(), user, books);

            return(record);
        }
示例#3
0
        public static Author Create(AuthorFullName authorFullName)
        {
            var author = new Author(TypedId.GetNewId <AuthorId>(), authorFullName);

            return(author);
        }
示例#4
0
 public static User Create(string name, string surname, string email)
 {
     return(new User(TypedId.GetNewId <UserId>(), name, surname, email));
 }