From 59948f88708eee523eb107bd40bd55eee79e4064 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Sat, 31 Jul 2021 14:52:44 +0800 Subject: [PATCH] Update db.WhereClass --- .../Abstract/QueryableProvider/QueryableProvider.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 92e152f80..fdc6d82bd 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -395,12 +395,20 @@ namespace SqlSugar } } - cons.ConditionalList.Add(new KeyValuePair(WhereType, new ConditionalModel() + var data = new KeyValuePair(WhereType, new ConditionalModel() { ConditionalType = ConditionalType.Equal, FieldName = column.DbColumnName, FieldValue = value.ObjToString() - })); + }); + cons.ConditionalList.Add(data); + if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL) + { + data.Value.FieldValueConvertFunc = it => + { + return UtilMethods.ChangeType2(it, value.GetType()); + }; + } } } if (cons.HasValue())