diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs index 4e926c101..7acefba28 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs @@ -262,11 +262,11 @@ namespace SqlSugar ++i; } } - protected string GetDbColumnName(string columns) + private string GetDbColumnName(string propertyName) { if (!IsMappingColumns) { - return columns; + return propertyName; } if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase))) { @@ -274,12 +274,12 @@ namespace SqlSugar } if (MappingColumnList == null || !MappingColumnList.Any()) { - return columns; + return propertyName; } else { - var mappInfo = this.Context.MappingColumns.FirstOrDefault(it => it.EntityName == EntityInfo.EntityName && it.PropertyName.Equals(columns, StringComparison.CurrentCultureIgnoreCase)); - return mappInfo == null ? columns : mappInfo.DbColumnName; + var mappInfo = this.MappingColumnList.FirstOrDefault(it => it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase)); + return mappInfo == null ? propertyName : mappInfo.DbColumnName; } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index f41bc731c..61bba6810 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -281,11 +281,11 @@ namespace SqlSugar 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) { - return entityName; + return propertyName; } if (this.Context.MappingColumns.Any(it => it.EntityName.Equals(EntityInfo.EntityName, StringComparison.CurrentCultureIgnoreCase))) { @@ -293,12 +293,12 @@ namespace SqlSugar } if (MappingColumnList == null || !MappingColumnList.Any()) { - return entityName; + return propertyName; } else { - var mappInfo = this.Context.MappingColumns.FirstOrDefault(it => it.PropertyName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase)); - return mappInfo == null ? entityName : mappInfo.DbColumnName; + var mappInfo = this.MappingColumnList.FirstOrDefault(it => it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase)); + return mappInfo == null ? propertyName : mappInfo.DbColumnName; } } private List GetPrimaryKeys() diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs index 7b95de8e2..b1fef35a2 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConnectionConfig.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -26,6 +27,7 @@ namespace SqlSugar /// /// Configure External Services replace default services,For example, Redis storage /// + [JsonIgnore] public ConfigureExternalServices ConfigureExternalServices = _DefaultServices; private static ConfigureExternalServices _DefaultServices = new ConfigureExternalServices(); ///