完善更新功能

This commit is contained in:
橙子
2023-01-31 20:09:54 +08:00
parent 5fb09c1c4a
commit 1c8f20440c
12 changed files with 77 additions and 21 deletions

View File

@@ -57,6 +57,11 @@ namespace Yi.Framework.Ddd.Services
where TGetListOutputDto : IEntityDto<TKey>
{
protected virtual Task<TEntity> MapToEntityAsync(TGetListInput getListinput)
{
return Task.FromResult(_mapper.Map<TEntity>(getListinput));
}
protected virtual Task<TEntity> MapToEntityAsync(TCreateInput createInput)
{
@@ -153,7 +158,6 @@ namespace Yi.Framework.Ddd.Services
{
throw new ArgumentNullException(nameof(id));
}
var entity = await MapToEntityAsync(input);
entity.Id = id;
await _repository.UpdateIgnoreNullAsync(entity);