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()); } }
public Task Add(CasePlanAggregate workflowDefinition, CancellationToken token) { _dbContext.CasePlans.Add(workflowDefinition.ToModel()); return(Task.CompletedTask); }