public async Task Handle(IDomainEvent <BoxAggregate, BoxId, BoxCreatedEvent> domainEvent) { var entity = new BoxEntity { AggregateId = domainEvent.AggregateIdentity.Value, Barcode = domainEvent.AggregateEvent.Barcode.Value, Created = domainEvent.Timestamp, Modified = domainEvent.Timestamp }; using (var db = new StorageDbContext(_dbContextOptions)) { await db.AddAsync(entity).ConfigureAwait(false); await db.SaveChangesAsync().ConfigureAwait(false); } }
public async Task CreateAsync(PresentationConfiguration record) { await _context.AddAsync(record); await _context.SaveChangesAsync(); }
public async Task CreateATaskAsync(ToDoList task) { await _context.AddAsync(task); await _context.SaveChangesAsync(); }