fix webapi 未设置代码生成 Load加载数据报错,MVC页面没有代码生成界面 https://gitee.com/yubaolee/OpenAuth.Core/issues/I4RLEP

This commit is contained in:
yubaolee
2022-02-21 00:39:55 +08:00
parent 3f077f5d80
commit ac0dfef321
8 changed files with 71 additions and 10 deletions

View File

@@ -34,13 +34,14 @@ namespace OpenAuth.App
}
/// <summary>
/// 获取数据库一个表的所有属性值及属性描述
/// 通过实体获取字段定义因为MVC版本没有代码生成界面只能通过这种方式
/// </summary>
/// <param name="moduleName">模块名称/表名</param>
/// <returns></returns>
public List<KeyDescription> GetProperties(string moduleName)
[Obsolete("因为MVC版本没有代码生成界面只能通过这种方式")]
public List<BuilderTableColumn> GetTableColumnsFromDb(string moduleName)
{
var result = new List<KeyDescription>();
var result = new List<BuilderTableColumn>();
const string domain = "openauth.repository.domain.";
IEntityType entity = null;
_contexts.ForEach(u =>
@@ -67,12 +68,13 @@ namespace OpenAuth.App
{
typeName = Nullable.GetUnderlyingType(property.PropertyType).Name;
}
result.Add(new KeyDescription
result.Add(new BuilderTableColumn
{
Key = property.Name,
Description = description,
Browsable = browsable,
Type = typeName
ColumnName = property.Name,
TableName = moduleName,
Comment = description,
IsList = browsable,
ColumnType = typeName
});
}