From 5ac8b7dd7a46930b8abf6a9ab6b161eddd8109d0 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Tue, 14 Jun 2022 09:32:42 +0800 Subject: [PATCH] v3.2.664 #1155 --- Directory.Build.props | 2 +- FreeSql.DbContext/FreeSql.DbContext.xml | 9 +++++++++ FreeSql/Internal/CommonUtils.cs | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) 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); } } }