コード例 #1
0
        public async Task Handle(BookAuthorConnectionCreatedDomainEvent notification, CancellationToken cancellationToken)
        {
            var bookAuthorCatalog = new BookAuthorCatalog(notification.Book, notification.Author);

            await bookAuthorCatalogRepository.AddAsync(bookAuthorCatalog);

            // bookAuthorCatalogRepository.UnitOfWork.SaveChangesAsync is not called here, because this notification handler can only be triggered
            // by SaveChangesAsync from somewhere else.
        }
コード例 #2
0
 public void Remove(BookAuthorCatalog catalog)
 {
     databaseContext.Remove(catalog);
 }
コード例 #3
0
 public async Task <BookAuthorCatalog> AddAsync(BookAuthorCatalog catalog)
 {
     return((await databaseContext.BookAuthorCatalog.AddAsync(catalog)).Entity);
 }