更新crud
This commit is contained in:
@@ -158,13 +158,12 @@ namespace Yi.Framework.Ddd.Services
|
||||
{
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
var entity = await MapToEntityAsync(input);
|
||||
entity.Id = id;
|
||||
await _repository.UpdateIgnoreNullAsync(entity);
|
||||
|
||||
var newEntity = await _repository.GetByIdAsync(id);
|
||||
var entity = await _repository.GetByIdAsync(id);
|
||||
await MapToEntityAsync(input, entity);
|
||||
await _repository.UpdateAsync(entity);
|
||||
|
||||
return await MapToGetOutputDtoAsync(newEntity);
|
||||
return await MapToGetOutputDtoAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user