public async Task <DataflowDto> PartialUpdateDataflowAsync(Guid id, UpdateDataflowDto updateDataflowDto, CancellationToken ct) { var dataflowEntity = await _uow.Dataflows.GetAsync(id, ct); _mapper.Map(updateDataflowDto, dataflowEntity); await _uow.Dataflows.UpdateAsync(dataflowEntity, id, ct, dataflowEntity.RowVersion); await _uow.SaveChangesAsync(ct); dataflowEntity = await _uow.Dataflows.GetAsync(id, ct); var dataflowDto = _mapper.Map <DataflowDto>(dataflowEntity); return(dataflowDto); }
public async Task <ActionResult> UpdateDataflow([FromRoute] Guid id, [FromBody] UpdateDataflowDto updateDataflowDto, CancellationToken ct) { if (!await _dataflowService.ExistsAsync(id, ct)) { return(NotFound()); } var dataflowToReturn = await _dataflowService.UpdateDataflowAsync(id, updateDataflowDto, ct); if (dataflowToReturn == null) { return(BadRequest()); } return(Ok(dataflowToReturn)); }
public async Task <DataflowDto> UpdateDataflowAsync(Guid id, UpdateDataflowDto updateDataflowDto, CancellationToken ct) { DataflowDto dataflowDto = null; var updatedEntity = _mapper.Map <Dataflow>(updateDataflowDto); updatedEntity.Id = id; await _uow.Dataflows.UpdateAsync(updatedEntity, id, ct, updatedEntity.RowVersion); await _uow.SaveChangesAsync(ct); var dataflowEntity = await _uow.Dataflows.GetAsync(id, ct); dataflowDto = _mapper.Map <DataflowDto>(dataflowEntity); return(dataflowDto); }