diff --git a/Directory.Build.props b/Directory.Build.props index 373f2363..03c0c575 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,7 +9,7 @@ - 3.2.663 + 3.2.664 diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml index 6b638cad..1ab5bf1c 100644 --- a/FreeSql.DbContext/FreeSql.DbContext.xml +++ b/FreeSql.DbContext/FreeSql.DbContext.xml @@ -795,5 +795,14 @@ + + + 批量注入 Repository,可以参考代码自行调整 + + + + + + diff --git a/FreeSql/Internal/CommonUtils.cs b/FreeSql/Internal/CommonUtils.cs index 786bc2b3..f502a05f 100644 --- a/FreeSql/Internal/CommonUtils.cs +++ b/FreeSql/Internal/CommonUtils.cs @@ -648,14 +648,18 @@ namespace FreeSql.Internal { var cbs = LocalGetComment(prop.DeclaringType, level + 1); if (cbs != null && cbs.TryGetValue(prop.Name, out var otherComment) && string.IsNullOrEmpty(otherComment) == false) - dic.Add(prop.Name, otherComment); + { + if (dic.ContainsKey(prop.Name)) dic[prop.Name] = otherComment; + else dic.Add(prop.Name, otherComment); + } } continue; } var comment = node.InnerXml.Trim(' ', '\r', '\n', '\t'); if (string.IsNullOrEmpty(comment)) continue; - dic.Add(prop.Name, comment); + if (dic.ContainsKey(prop.Name)) dic[prop.Name] = comment; + else dic.Add(prop.Name, comment); } } }