mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
-
This commit is contained in:
@@ -102,7 +102,7 @@ namespace SqlSugar
|
||||
return typeof(T).GetProperties().First(it => it.Name == propertyName);
|
||||
}
|
||||
#region Primary key
|
||||
private static void SetColumns(EntityInfo result)
|
||||
private void SetColumns(EntityInfo result)
|
||||
{
|
||||
foreach (var property in result.Type.GetProperties())
|
||||
{
|
||||
@@ -141,6 +141,18 @@ namespace SqlSugar
|
||||
column.IsIgnore = true;
|
||||
}
|
||||
}
|
||||
if (this.Context.MappingColumns.HasValue())
|
||||
{
|
||||
var golbalMappingInfo = this.Context.MappingColumns.FirstOrDefault(it => it.EntityName.Equals(result.EntityName, StringComparison.CurrentCultureIgnoreCase) && it.PropertyName == column.PropertyName);
|
||||
if (golbalMappingInfo != null)
|
||||
column.DbColumnName = golbalMappingInfo.DbColumnName;
|
||||
}
|
||||
if (this.Context.IgnoreColumns.HasValue())
|
||||
{
|
||||
var golbalMappingInfo = this.Context.IgnoreColumns.FirstOrDefault(it => it.EntityName.Equals(result.EntityName, StringComparison.CurrentCultureIgnoreCase) && it.PropertyName == column.PropertyName);
|
||||
if (golbalMappingInfo != null)
|
||||
column.IsIgnore = true;
|
||||
}
|
||||
result.Columns.Add(column);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user