@@ -54,7 +54,7 @@ public List<T> ConvertToList<T>()
54
54
55
55
public List < T > ConvertToScalarList < T > ( )
56
56
{
57
- if ( ! ( ( typeof ( T ) . IsPrimitive ) || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
57
+ if ( ! ( ( typeof ( T ) . IsPrimitive ) || typeof ( T ) . IsValueType || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
58
58
throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Use ConvertToList function." ) ;
59
59
60
60
IDataReader reader = null ;
@@ -90,7 +90,7 @@ public T ConvertTo<T>()
90
90
91
91
public T ConvertToScalar < T > ( )
92
92
{
93
- if ( ! ( ( typeof ( T ) . IsPrimitive ) || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
93
+ if ( ! ( ( typeof ( T ) . IsPrimitive ) || typeof ( T ) . IsValueType || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
94
94
throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Use ConvertTo function." ) ;
95
95
96
96
IDataReader reader = null ;
@@ -108,7 +108,7 @@ public T ConvertToScalar<T>()
108
108
109
109
public List < T > ConvertFirstColumnToList < T > ( )
110
110
{
111
- if ( ! ( ( typeof ( T ) . IsPrimitive ) || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
111
+ if ( ! ( ( typeof ( T ) . IsPrimitive ) || typeof ( T ) . IsValueType || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
112
112
throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Only primitive type can be used." ) ;
113
113
114
114
IDataReader reader = null ;
@@ -126,7 +126,7 @@ public List<T> ConvertFirstColumnToList<T>()
126
126
127
127
public HashSet < T > ConvertFirstColumnToListDistinct < T > ( )
128
128
{
129
- if ( ! ( ( typeof ( T ) . IsPrimitive ) || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
129
+ if ( ! ( ( typeof ( T ) . IsPrimitive ) || typeof ( T ) . IsValueType || ( typeof ( T ) == typeof ( string ) ) || ( typeof ( T ) == typeof ( String ) ) ) )
130
130
throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Only primitive type can be used." ) ;
131
131
132
132
IDataReader reader = null ;
0 commit comments