示例#1
0
        public async Task Update(CasePlanAggregate workflowDefinition, CancellationToken token)
        {
            using (var lck = await _dbContext.Lock())
            {
                var result = await _dbContext.CasePlans.FirstOrDefaultAsync(_ => _.Id == workflowDefinition.AggregateId, token);

                if (result == null)
                {
                    return;
                }

                _dbContext.CasePlans.Remove(result);
                _dbContext.CasePlans.Add(workflowDefinition.ToModel());
            }
        }
示例#2
0
 public Task Add(CasePlanAggregate workflowDefinition, CancellationToken token)
 {
     _dbContext.CasePlans.Add(workflowDefinition.ToModel());
     return(Task.CompletedTask);
 }