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. }
public void Remove(BookAuthorCatalog catalog) { databaseContext.Remove(catalog); }
public async Task <BookAuthorCatalog> AddAsync(BookAuthorCatalog catalog) { return((await databaseContext.BookAuthorCatalog.AddAsync(catalog)).Entity); }