Add disable XML reading configuration

This commit is contained in:
sunkaixuan
2022-11-13 10:04:01 +08:00
parent fb0fb4bb1a
commit ee92bd29a4
3 changed files with 8 additions and 1 deletions

View File

@@ -151,6 +151,10 @@ namespace SqlSugar
/// <returns>the text contents of this XML element node</returns>
public string GetXElementNodeValue(Type entityType, string nodeAttributeName)
{
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsNoReadXmlDescription == true)
{
return "";
}
var path = entityType.Assembly.Location;
if (string.IsNullOrEmpty(path))
{

View File

@@ -17,5 +17,6 @@ namespace SqlSugar
public int DefaultCacheDurationInSeconds { get; set; }
public bool? TableEnumIsString { get; set; }
public DateTime? DbMinDate { get; set; } = Convert.ToDateTime("1900-01-01");
public bool IsNoReadXmlDescription { get; set; }
}
}

View File

@@ -173,7 +173,9 @@ namespace SqlSugar
IsWithNoLockQuery = it.MoreSettings.IsWithNoLockQuery,
TableEnumIsString = it.MoreSettings.TableEnumIsString,
DisableMillisecond = it.MoreSettings.DisableMillisecond,
DbMinDate=it.MoreSettings.DbMinDate
DbMinDate=it.MoreSettings.DbMinDate,
IsNoReadXmlDescription=it.MoreSettings.IsNoReadXmlDescription
},
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
{