From 36aeb875e9e17943bd337790fdc7888ed84bd871 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 21 Oct 2017 16:34:23 +0800 Subject: [PATCH] 4.5.9.2 --- .../SqlSugar/Infrastructure/ContextMethods.cs | 16 ++++++++-------- Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index 23ba2dce0..7a1eb51f3 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -114,9 +114,9 @@ namespace SqlSugar } else { - if (readerValues.ContainsKey(name)) + if (readerValues.Any(it => it.Key.Equals(name, StringComparison.CurrentCultureIgnoreCase))) { - var addValue = readerValues[name]; + var addValue = readerValues.ContainsKey(name) ? readerValues[name] : readerValues[name.ToUpper()]; if (addValue == DBNull.Value) { if (item.PropertyType.IsIn(UtilConstants.IntType, UtilConstants.DecType, UtilConstants.DobType, UtilConstants.ByteType)) @@ -296,23 +296,23 @@ namespace SqlSugar { if (models.IsNullOrEmpty()) return new KeyValuePair(); StringBuilder builder = new StringBuilder(); - List parameters = new List() ; + List parameters = new List(); var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig); foreach (var item in models) { var index = models.IndexOf(item); - var type = index == 0?"":"AND"; + var type = index == 0 ? "" : "AND"; string temp = " {0} {1} {2} {3} "; - string parameterName = string.Format("{0}Conditional{1}{2}",sqlBuilder.SqlParameterKeyWord,item.FieldName,index); + string parameterName = string.Format("{0}Conditional{1}{2}", sqlBuilder.SqlParameterKeyWord, item.FieldName, index); switch (item.ConditionalType) { case ConditionalType.Equal: - builder.AppendFormat(temp,type,item.FieldName.ToSqlFilter(),"=", parameterName); - parameters.Add(new SugarParameter(parameterName,item.FieldValue)); + builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", parameterName); + parameters.Add(new SugarParameter(parameterName, item.FieldValue)); break; case ConditionalType.Like: builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "LIKE", parameterName); - parameters.Add(new SugarParameter(parameterName, "%"+item.FieldValue+"%")); + parameters.Add(new SugarParameter(parameterName, "%" + item.FieldValue + "%")); break; case ConditionalType.GreaterThan: builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), ">", parameterName); diff --git a/Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs b/Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs index 892750e73..b51567464 100644 --- a/Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs +++ b/Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.5.9.1")] -[assembly: AssemblyFileVersion("4.5.9.1")] +[assembly: AssemblyVersion("4.5.9.2")] +[assembly: AssemblyFileVersion("4.5.9.2")]