diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt
index 7441b42..3727ab9 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplControllers.txt
@@ -88,7 +88,7 @@ $if(replaceDto.ShowBtnAdd)
var response = _${replaceDto.ModelTypeName}Service.Add${replaceDto.ModelTypeName}(modal);
- return ToResponse(response);
+ return SUCCESS(response);
}
$end
diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt
index 90d2588..9e4cc3d 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplIService.txt
@@ -18,7 +18,7 @@ namespace ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNam
$if(genTable.TplCategory == "tree")
List<${replaceDto.ModelTypeName}> GetTreeList(${replaceDto.ModelTypeName}QueryDto parm);
$end
- int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
+ ${replaceDto.ModelTypeName} Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
int Update${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
$if(replaceDto.ShowBtnTruncate)
diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt
index 2465033..9a26f93 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplService.txt
@@ -112,12 +112,12 @@ $end
///
///
///
- public int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} model)
+ public ${replaceDto.ModelTypeName} Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} model)
{
$if(null != genTable.SubTableName && "" != genTable.SubTableName)
- return Context.InsertNav(model).Include(s1 => s1.${genTable.SubTable.ClassName}Nav).ExecuteCommand() ? 1 : 0;
+ return Context.InsertNav(model).Include(s1 => s1.${genTable.SubTable.ClassName}Nav).ExecuteReturnEntity();
$else
- return Add(model, true);
+ return Insertable(model).IgnoreColumns(true).ExecuteReturnEntity();
$end
}