|
|
@ -90,9 +90,7 @@ namespace Volo.Abp.Application.Services |
|
|
await CheckCreatePolicyAsync(); |
|
|
await CheckCreatePolicyAsync(); |
|
|
|
|
|
|
|
|
var entity = MapToEntity(input); |
|
|
var entity = MapToEntity(input); |
|
|
|
|
|
await Repository.InsertAsync(entity, autoSave: true); |
|
|
await Repository.InsertAsync(entity); |
|
|
|
|
|
await CurrentUnitOfWork.SaveChangesAsync(); |
|
|
|
|
|
|
|
|
|
|
|
return MapToEntityDto(entity); |
|
|
return MapToEntityDto(entity); |
|
|
} |
|
|
} |
|
|
@ -102,12 +100,9 @@ namespace Volo.Abp.Application.Services |
|
|
await CheckUpdatePolicyAsync(); |
|
|
await CheckUpdatePolicyAsync(); |
|
|
|
|
|
|
|
|
var entity = await GetEntityByIdAsync(id); |
|
|
var entity = await GetEntityByIdAsync(id); |
|
|
|
|
|
|
|
|
//TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise
|
|
|
//TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise
|
|
|
|
|
|
|
|
|
MapToEntity(input, entity); |
|
|
MapToEntity(input, entity); |
|
|
await Repository.UpdateAsync(entity); |
|
|
await Repository.UpdateAsync(entity, autoSave: true); |
|
|
await CurrentUnitOfWork.SaveChangesAsync(); |
|
|
|
|
|
|
|
|
|
|
|
return MapToEntityDto(entity); |
|
|
return MapToEntityDto(entity); |
|
|
} |
|
|
} |
|
|
|