From 83a44b31bb934371e26ba5483119ca7b2c6a2407 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 11 Nov 2018 20:21:08 +0800 Subject: [PATCH] DateTimeOffset BUG --- .../SqlSugar/ExpressionsToSql/Common/SugarParameter.cs | 4 ++++ Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs index 78e64abfe..a9e9484b4 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs @@ -91,6 +91,10 @@ namespace SqlSugar { this.DbType = System.Data.DbType.String; } + else if (type == UtilConstants.DateTimeOffsetType) + { + this.DbType = System.Data.DbType.DateTimeOffset; + } } public SugarParameter(string name, object value, bool isOutput) diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs index be785ca74..0119b2a9d 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilConstants.cs @@ -27,6 +27,7 @@ namespace SqlSugar internal static Type DecType = typeof(decimal); internal static Type StringType = typeof(string); internal static Type DateType = typeof(DateTime); + internal static Type DateTimeOffsetType = typeof(DateTimeOffset); internal static Type ByteArrayType = typeof(byte[]); internal static Type ModelType= typeof(ModelContext); internal static Type DynamicType = typeof(ExpandoObject);