示例#1
0
        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));
        }
示例#2
0
        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();
        }
示例#3
0
        public void Handle_BlankCategory_ThrowsException()
        {
            var event1 = new CreatingEvent();

            _sut.Handle(event1);
        }
示例#4
0
 public void CreatingSnapshotHandle(TSnapshot snapshotState, CreatingEvent <TSnapshot> evt)
 {
     this.Mapper.Map(evt.Snapshot, snapshotState);
 }