mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
feat: 强化代码生成器
This commit is contained in:
@@ -413,6 +413,15 @@ namespace OpenAuth.App
|
|||||||
attributeBuilder.Append("\r\n\r\n ");
|
attributeBuilder.Append("\r\n\r\n ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查找是否存在子表的情况
|
||||||
|
var subTable = Repository.FirstOrDefault(u => u.ParentTableId == sysTableInfo.Id);
|
||||||
|
|
||||||
|
if (subTable != null) //如果子表存在,需要加子表的请求参数
|
||||||
|
{
|
||||||
|
attributeBuilder.Append($" public List<AddOrUpdate{subTable.ClassName}Req> {subTable.ClassName}Reqs {{ get; set; }}");
|
||||||
|
attributeBuilder.Append("\r\n\r\n ");
|
||||||
|
}
|
||||||
|
|
||||||
domainContent = domainContent.Replace("{ClassName}", sysTableInfo.ClassName)
|
domainContent = domainContent.Replace("{ClassName}", sysTableInfo.ClassName)
|
||||||
.Replace("{AttributeList}", attributeBuilder.ToString());
|
.Replace("{AttributeList}", attributeBuilder.ToString());
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using OpenAuth.Repository.Core;
|
using OpenAuth.Repository.Core;
|
||||||
|
@@ -60,7 +60,6 @@ namespace OpenAuth.App
|
|||||||
Repository.Update(u => new {ClassName}
|
Repository.Update(u => new {ClassName}
|
||||||
{
|
{
|
||||||
//todo: 根据业务需要调整字段
|
//todo: 根据业务需要调整字段
|
||||||
{ClassName} = obj.{ClassName},
|
|
||||||
Updatetime = DateTime.Now,
|
Updatetime = DateTime.Now,
|
||||||
Updateuserid = user.Id,
|
Updateuserid = user.Id,
|
||||||
Updateusername = user.Name
|
Updateusername = user.Name
|
||||||
|
Reference in New Issue
Block a user