⚡ 代码生成添加方法返回实体类
This commit is contained in:
parent
95b0178dd4
commit
6d6a03ddea
@ -88,7 +88,7 @@ $if(replaceDto.ShowBtnAdd)
|
||||
|
||||
var response = _${replaceDto.ModelTypeName}Service.Add${replaceDto.ModelTypeName}(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
$end
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -112,12 +112,12 @@ $end
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user