From 514c1cd6d2e44b9f9b0f916bf5221571184d9f8e Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Fri, 24 Nov 2023 13:16:58 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E8=A1=A5=E5=85=85=20=E8=BE=BE=E6=A2=A6=20I?= =?UTF-8?q?DbFirst=20datetime=20=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Providers/FreeSql.Provider.Dameng/DamengDbFirst.cs | 3 ++- Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Providers/FreeSql.Provider.Dameng/DamengDbFirst.cs b/Providers/FreeSql.Provider.Dameng/DamengDbFirst.cs index 0f55c5ebf..12619e67a 100644 --- a/Providers/FreeSql.Provider.Dameng/DamengDbFirst.cs +++ b/Providers/FreeSql.Provider.Dameng/DamengDbFirst.cs @@ -55,7 +55,8 @@ DmDbType GetSqlDbType(DbColumnInfo column) case "char(36)": return DmDbType.Char; } - switch (column.DbTypeText?.ToLower()) + if (dbfull?.StartsWith("datetime(") == true) return DmDbType.DateTime; + switch (column.DbTypeText?.ToLower()) { case "bit": _dicDbToCs.TryAdd(dbfull, _dicDbToCs["number(1)"]); diff --git a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs index cb721b491..fe7921cd2 100644 --- a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs +++ b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs @@ -54,8 +54,9 @@ OdbcType GetSqlDbType(DbColumnInfo column) case "nvarchar2(255)": return OdbcType.NVarChar; case "char(36)": return OdbcType.Char; - } - switch (column.DbTypeText?.ToLower()) + } + if (dbfull?.StartsWith("datetime(") == true) return OdbcType.DateTime; + switch (column.DbTypeText?.ToLower()) { case "bit": _dicDbToCs.TryAdd(dbfull, _dicDbToCs["number(1)"]);