diff --git a/Src/Asp.Net/SqlSugar/Entities/DefaultCustom.cs b/Src/Asp.Net/SqlSugar/Entities/DefaultCustom.cs index 34e101ea9..ba247b3b1 100644 --- a/Src/Asp.Net/SqlSugar/Entities/DefaultCustom.cs +++ b/Src/Asp.Net/SqlSugar/Entities/DefaultCustom.cs @@ -67,4 +67,22 @@ namespace SqlSugar.DbConvert return (T)UtilMethods.ChangeType2(value, typeof(T)); } } + + + public class Nvarchar2PropertyConvert : 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) { IsNvarchar2=true }; + } + + public T QueryConverter(IDataRecord dr, int i) + { + + var value = dr.GetString(i); + return (T)(object)value; + } + } }