修复DObject转对象的错误,不能使用Adapt,改成使用json反序列化

This commit is contained in:
2023-09-25 11:45:45 +08:00
parent 821737473e
commit bc8401c8e9
2 changed files with 9 additions and 18 deletions

View File

@@ -83,7 +83,7 @@ public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
{
ThrowIf.IsNull(input.data);
//ArgumentNullException.ThrowIfNull(input.data);
Vmodel vm = input.data.Adapt<Vmodel>();
Vmodel vm = input.data.ToObject<Vmodel>();
vm.areaCode = vm.areaCode.ToKebab();
vm.vmCode = vm.vmCode.ToKebab();
await _db.Insertable(vm).ExecuteCommandAsync();
@@ -97,7 +97,7 @@ public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
{
ThrowIf.IsNull(input.data);
//ArgumentNullException.ThrowIfNull(input.data);
Vmodel vm = input.data.Adapt<Vmodel>();
Vmodel vm = input.data.ToObject<Vmodel>();
vm.areaCode = vm.areaCode.ToKebab();
vm.vmCode = vm.vmCode.ToKebab();
vm.navProps.ForEach(a => a.naviModel = null);