- 修复 根据代码注释,迁移到数据库备注,当实体类属于 .exe 程序集时的 bug;

This commit is contained in:
28810
2019-07-02 14:56:40 +08:00
parent f8c3608fda
commit 0a206b588f
12 changed files with 20 additions and 210 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<Version>0.7.1</Version>
<Version>0.7.2</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>YeXiangQin</Authors>
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>

View File

@ -282,7 +282,7 @@ namespace FreeSql.Internal
/// <returns>Dictkey=属性名value=注释</returns>
public static Dictionary<string, string> GetProperyCommentBySummary(Type type)
{
var xmlPath = type.Assembly.Location.Replace(".dll", ".xml");
var xmlPath = type.Assembly.Location.Replace(".dll", ".xml").Replace(".exe", ".xml");
if (File.Exists(xmlPath) == false) return null;
var dic = new Dictionary<string, string>();
@ -290,7 +290,15 @@ namespace FreeSql.Internal
var sReader = new StringReader(File.ReadAllText(xmlPath));
using (var xmlReader = XmlReader.Create(sReader))
{
var xpath = new XPathDocument(xmlReader);
XPathDocument xpath = null;
try
{
xpath = new XPathDocument(xmlReader);
}
catch
{
return null;
}
var xmlNav = xpath.CreateNavigator();
var props = type.GetProperties();