public async Task UpdateAsync(Guid?processId, ProcessRequestTO processRequestTO) { var processEntity = await _processRepository.GetByIdWithIncludesAsync(processId.Value); processEntity.UnifiedProcessNumber = processRequestTO.UnifiedProcessNumber; processEntity.ClientPhysicalFolder = processRequestTO.ClientPhysicalFolder; processEntity.DistributionDate = processRequestTO.DistributionDate; processEntity.LinkedProcessId = processRequestTO.LinkedProcessId; processEntity.JusticeSecret = processRequestTO.JusticeSecret; processEntity.Description = processRequestTO.Description; processEntity.SituationId = processRequestTO.SituationId; processEntity.ProcessResponsible = new List <ProcessResponsibleEntity>(); foreach (var responsibleId in processRequestTO.Responsibles) { processEntity.ProcessResponsible.Add(new ProcessResponsibleEntity { ResponsibleId = responsibleId }); } processEntity.UpdateUserName = processRequestTO.UpdateUserName; processEntity.Version = processEntity.Version + 1; processEntity.UpdateDate = DateTime.Now; await _processRepository.UpdateAsync(processEntity); }