예제 #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));
 }