public virtual Task Create(TSnapshotDto snapshot, string flowId = "") { var snapshotState = this.Mapper.Map <TSnapshotType>(snapshot); var evt = new CreatingEvent <TSnapshotType>(snapshotState); return(this.RaiseEvent(evt, flowId)); }
protected virtual async Task CreatingSnapshotHandle(CreatingEvent <TSnapshot> evt) { await using var dbContext = this.GetDbContext(); var entity = this.mapper.Map <TEntityType>(evt.Snapshot); await dbContext.AddAsync(entity); await dbContext.SaveChangesAsync(); }
public void Handle_BlankCategory_ThrowsException() { var event1 = new CreatingEvent(); _sut.Handle(event1); }
public void CreatingSnapshotHandle(TSnapshot snapshotState, CreatingEvent <TSnapshot> evt) { this.Mapper.Map(evt.Snapshot, snapshotState); }