Skip to content

Commit

Permalink
表名字段属性未设置,自动生成时,默认使用小写.
Browse files Browse the repository at this point in the history
  • Loading branch information
279328316 committed Jul 28, 2023
1 parent b3f9720 commit 5e02dc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Jc.Core.Database/Data/Query/DtoMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public string GetTableName(string subTableArg = null)
}
else if(string.IsNullOrEmpty(tableName))
{ //未设置表名称.则以类名称作为表名称
tableName = EntityType.Name;
tableName = EntityType.Name.ToLower();
}
return tableName;
}
Expand Down
6 changes: 5 additions & 1 deletion Jc.Core.Database/Data/Query/DtoMappingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ public static TableAttribute GetDtoTableAttr<T>()
if (attr == null)
{ //如果未设置,默认使用类名称
attr = new TableAttribute();
attr.Name = type.Name;
attr.Name = type.Name.ToLower();
attr.DisplayText = type.Name;
}
else if (string.IsNullOrEmpty(attr.Name))
{
attr.Name = type.Name.ToLower();
}
return attr;
}

Expand Down

0 comments on commit 5e02dc5

Please sign in to comment.