DateTime19.cs 740 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Data;
  3. namespace SqlSugar.BzTDengineCore
  4. {
  5. internal enum Date19
  6. {
  7. time = 19
  8. }
  9. public class DateTime19 : ISugarDataConverter
  10. {
  11. public SugarParameter ParameterConverter<T>(object columnValue, int columnIndex)
  12. {
  13. var name = "@Common" + columnIndex;
  14. Type undertype = UtilMethods.GetUnderType(typeof(T));//获取没有nullable的枚举类型
  15. return new SugarParameter(name, columnValue, undertype) { CustomDbType = typeof(Date19) };
  16. }
  17. public T QueryConverter<T>(IDataRecord dr, int i)
  18. {
  19. var value = dr.GetValue(i);
  20. return (T)UtilMethods.ChangeType2(value, typeof(T));
  21. }
  22. }
  23. }