mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
-
This commit is contained in:
@@ -262,11 +262,11 @@ namespace SqlSugar
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected string GetDbColumnName(string columns)
|
private string GetDbColumnName(string propertyName)
|
||||||
{
|
{
|
||||||
if (!IsMappingColumns)
|
if (!IsMappingColumns)
|
||||||
{
|
{
|
||||||
return columns;
|
return propertyName;
|
||||||
}
|
}
|
||||||
if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase)))
|
if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
@@ -274,12 +274,12 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
if (MappingColumnList == null || !MappingColumnList.Any())
|
if (MappingColumnList == null || !MappingColumnList.Any())
|
||||||
{
|
{
|
||||||
return columns;
|
return propertyName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var mappInfo = this.Context.MappingColumns.FirstOrDefault(it => it.EntityName == EntityInfo.EntityName && it.PropertyName.Equals(columns, StringComparison.CurrentCultureIgnoreCase));
|
var mappInfo = this.MappingColumnList.FirstOrDefault(it => it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
return mappInfo == null ? columns : mappInfo.DbColumnName;
|
return mappInfo == null ? propertyName : mappInfo.DbColumnName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -281,11 +281,11 @@ namespace SqlSugar
|
|||||||
this.UpdateBuilder.Parameters.RemoveAll(it => this.UpdateBuilder.SetValues.Any(v => (SqlBuilder.SqlParameterKeyWord + SqlBuilder.GetNoTranslationColumnName(v.Key)) == it.ParameterName));
|
this.UpdateBuilder.Parameters.RemoveAll(it => this.UpdateBuilder.SetValues.Any(v => (SqlBuilder.SqlParameterKeyWord + SqlBuilder.GetNoTranslationColumnName(v.Key)) == it.ParameterName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string GetDbColumnName(string entityName)
|
private string GetDbColumnName(string propertyName)
|
||||||
{
|
{
|
||||||
if (!IsMappingColumns)
|
if (!IsMappingColumns)
|
||||||
{
|
{
|
||||||
return entityName;
|
return propertyName;
|
||||||
}
|
}
|
||||||
if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase)))
|
if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
@@ -293,12 +293,12 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
if (MappingColumnList == null || !MappingColumnList.Any())
|
if (MappingColumnList == null || !MappingColumnList.Any())
|
||||||
{
|
{
|
||||||
return entityName;
|
return propertyName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var mappInfo = this.Context.MappingColumns.FirstOrDefault(it => it.PropertyName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase));
|
var mappInfo = this.MappingColumnList.FirstOrDefault(it => it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
return mappInfo == null ? entityName : mappInfo.DbColumnName;
|
return mappInfo == null ? propertyName : mappInfo.DbColumnName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private List<string> GetPrimaryKeys()
|
private List<string> GetPrimaryKeys()
|
||||||
|
Reference in New Issue
Block a user