@@ -54,7 +54,7 @@ public List<T> ConvertToList<T>()
5454
5555 public List < T > ConvertToScalarList < T > ( )
5656 {
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 ) ) ) )
5858 throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Use ConvertToList function." ) ;
5959
6060 IDataReader reader = null ;
@@ -90,7 +90,7 @@ public T ConvertTo<T>()
9090
9191 public T ConvertToScalar < T > ( )
9292 {
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 ) ) ) )
9494 throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Use ConvertTo function." ) ;
9595
9696 IDataReader reader = null ;
@@ -108,7 +108,7 @@ public T ConvertToScalar<T>()
108108
109109 public List < T > ConvertFirstColumnToList < T > ( )
110110 {
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 ) ) ) )
112112 throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Only primitive type can be used." ) ;
113113
114114 IDataReader reader = null ;
@@ -126,7 +126,7 @@ public List<T> ConvertFirstColumnToList<T>()
126126
127127 public HashSet < T > ConvertFirstColumnToListDistinct < T > ( )
128128 {
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 ) ) ) )
130130 throw new Exception ( "Type " + typeof ( T ) . Name + " is a non primitive type. Only primitive type can be used." ) ;
131131
132132 IDataReader reader = null ;
0 commit comments