mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 增加 [Description] 元数据注释,优先级低于 c# 代码注释;
This commit is contained in:
@ -69,7 +69,10 @@ namespace FreeSql.Internal
|
||||
var propsLazy = new List<NaviteTuple<PropertyInfo, bool, bool, MethodInfo, MethodInfo>>();
|
||||
var propsNavObjs = new List<PropertyInfo>();
|
||||
var propsComment = CommonUtils.GetProperyCommentBySummary(entity);
|
||||
var propsCommentByDescAttr = CommonUtils.GetPropertyCommentByDescriptionAttribute(entity);
|
||||
trytb.Comment = propsComment != null && propsComment.TryGetValue("", out var tbcomment) ? tbcomment : "";
|
||||
if (string.IsNullOrEmpty(trytb.Comment) && propsCommentByDescAttr != null && propsCommentByDescAttr.TryGetValue("", out tbcomment)) trytb.Comment = tbcomment;
|
||||
|
||||
var columnsList = new List<ColumnInfo>();
|
||||
foreach (var p in trytb.Properties.Values)
|
||||
{
|
||||
@ -148,6 +151,9 @@ namespace FreeSql.Internal
|
||||
};
|
||||
if (propsComment != null && propsComment.TryGetValue(p.Name, out var trycomment))
|
||||
col.Comment = trycomment;
|
||||
if (string.IsNullOrEmpty(col.Comment) && propsCommentByDescAttr != null && propsCommentByDescAttr.TryGetValue(p.Name, out trycomment))
|
||||
col.Comment = trycomment;
|
||||
|
||||
if (colattr.IsIgnore)
|
||||
{
|
||||
trytb.ColumnsByCsIgnore.Add(p.Name, col);
|
||||
|
Reference in New Issue
Block a user