public async Task HandleAsync(AuctionItemRemovedEvent @event) { var item = await _readStore.GetAuctionItemAsync(@event.AggregateId, @event.Name); _readStore.Remove(item); await _readStore.SaveAsync(); }
public async Task HandleAsync(AuctionUpdatedEvent @event) { var auction = await _readStore.GetAuctionAsync(@event.AggregateId); auction.Name = @event.Name ?? auction.Name; auction.AuctionDate = @event.AuctionDate ?? auction.AuctionDate; await _readStore.SaveAsync(); }
public async Task HandleAsync(AuctionCreatedEvent @event) { _readStore.Add(new AuctionReadModel { Id = @event.AggregateId, Name = @event.Name, AuctionDate = @event.AuctionDate }); await _readStore.SaveAsync(); }
public async Task HandleAsync(AuctionItemAddedEvent @event) { _readStore.Add(new AuctionItemReadModel { AuctionId = @event.AggregateId, Name = @event.Item.Name, Description = @event.Item.Description, Donor = @event.Item.Donor, Quantity = @event.Item.Quantity }); await _readStore.SaveAsync(); }