From 878d4389f52f55a63f0bb7c3af27dca975f59663 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 26 Aug 2023 03:45:13 +0800 Subject: [PATCH] - --- .../SqlSugar.TDengineCore/Tools/DateTime16.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime16.cs diff --git a/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime16.cs b/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime16.cs new file mode 100644 index 000000000..0ebab3ed6 --- /dev/null +++ b/Src/Asp.NetCore2/SqlSugar.TDengineCore/Tools/DateTime16.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace SqlSugar +{ + public class DateTime16: ISugarDataConverter + { + public SugarParameter ParameterConverter(object columnValue, int columnIndex) + { + var name = "@Common" + columnIndex; + Type undertype = SqlSugar.UtilMethods.GetUnderType(typeof(T));//获取没有nullable的枚举类型 + return new SugarParameter(name, columnValue, undertype) { CustomDbType=System.Data.DbType.DateTime2 }; + } + + public T QueryConverter(IDataRecord dr, int i) + { + + var value = dr.GetValue(i); + return (T)UtilMethods.ChangeType2(value, typeof(T)); + } + } +}