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);