Browse Source

-

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
07287e33e1
  1. 11
      Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs

11
Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs

@ -121,14 +121,13 @@ namespace SqlSugar
} }
} }
} }
if (Context.IgnoreColumns != null && Context.IgnoreColumns.Any(it => it.PropertyName.Equals(propertyInfo.Name, StringComparison.CurrentCultureIgnoreCase) if (IsIgnore(type, propertyInfo))
&& it.EntityName.Equals(type.Name, StringComparison.CurrentCultureIgnoreCase)))
{ {
continue; continue;
} }
if (propertyInfo != null && propertyInfo.GetSetMethod() != null) if (propertyInfo != null && propertyInfo.GetSetMethod() != null)
{ {
if (propertyInfo.PropertyType.IsClass() && propertyInfo.PropertyType != UtilConstants.ByteArrayType&&propertyInfo.PropertyType!=UtilConstants.ObjType) if (propertyInfo.PropertyType.IsClass() && propertyInfo.PropertyType != UtilConstants.ByteArrayType && propertyInfo.PropertyType != UtilConstants.ObjType)
{ {
BindClass(generator, result, propertyInfo); BindClass(generator, result, propertyInfo);
} }
@ -146,9 +145,15 @@ namespace SqlSugar
DynamicBuilder.handler = (Load)method.CreateDelegate(typeof(Load)); DynamicBuilder.handler = (Load)method.CreateDelegate(typeof(Load));
return DynamicBuilder; return DynamicBuilder;
} }
#endregion #endregion
#region Private methods #region Private methods
private bool IsIgnore(Type type, PropertyInfo propertyInfo)
{
return Context.IgnoreColumns != null && Context.IgnoreColumns.Any(it => it.PropertyName.Equals(propertyInfo.Name, StringComparison.CurrentCultureIgnoreCase)
&& it.EntityName.Equals(type.Name, StringComparison.CurrentCultureIgnoreCase));
}
private void BindClass(ILGenerator generator, LocalBuilder result, PropertyInfo propertyInfo) private void BindClass(ILGenerator generator, LocalBuilder result, PropertyInfo propertyInfo)
{ {

Loading…
Cancel
Save