Merge branch 'master' into net6.0

This commit is contained in:
不做码农 2022-03-13 19:17:35 +08:00
commit 7d134bc832
2 changed files with 6 additions and 6 deletions

View File

@ -95,9 +95,9 @@ $if(replaceDto.ShowBtnAdd)
throw new CustomException("请求参数错误");
}
//从 Dto 映射到 实体
var model = parm.Adapt<${replaceDto.ModelTypeName}>().ToCreate(HttpContext);
var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToCreate(HttpContext);
var response = _${replaceDto.ModelTypeName}Service.Insert(model, it => new
var response = _${replaceDto.ModelTypeName}Service.Insert(modal, it => new
{
$foreach(item in genTable.Columns)
$if((item.IsInsert))
@ -124,14 +124,14 @@ $if(replaceDto.ShowBtnEdit)
throw new CustomException("请求实体不能为空");
}
//从 Dto 映射到 实体
var model = parm.Adapt<${replaceDto.ModelTypeName}>().ToUpdate(HttpContext);
var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToUpdate(HttpContext);
var response = _${replaceDto.ModelTypeName}Service.Update(w => w.${replaceDto.PKName} == model.${replaceDto.PKName}, it => new ${replaceDto.ModelTypeName}()
var response = _${replaceDto.ModelTypeName}Service.Update(w => w.${replaceDto.PKName} == modal.${replaceDto.PKName}, it => new ${replaceDto.ModelTypeName}()
{
//Update 字段映射
$foreach(item in genTable.Columns)
$if((item.IsEdit))
$item.CsharpField = model.$item.CsharpField,
$item.CsharpField = modal.$item.CsharpField,
$end
${end}
});