@@ -285,14 +285,48 @@ public ReadOnlyCollection<DbColumn> GetColumnSchema()
285
285
286
286
public override T GetFieldValue < T > ( int ordinal )
287
287
{
288
+ if ( typeof ( T ) == typeof ( bool ) )
289
+ return ( T ) ( object ) GetBoolean ( ordinal ) ;
290
+ if ( typeof ( T ) == typeof ( byte ) )
291
+ return ( T ) ( object ) GetByte ( ordinal ) ;
292
+ if ( typeof ( T ) == typeof ( sbyte ) )
293
+ return ( T ) ( object ) GetSByte ( ordinal ) ;
294
+ if ( typeof ( T ) == typeof ( short ) )
295
+ return ( T ) ( object ) GetInt16 ( ordinal ) ;
296
+ if ( typeof ( T ) == typeof ( ushort ) )
297
+ return ( T ) ( object ) GetUInt16 ( ordinal ) ;
298
+ if ( typeof ( T ) == typeof ( int ) )
299
+ return ( T ) ( object ) GetInt32 ( ordinal ) ;
300
+ if ( typeof ( T ) == typeof ( uint ) )
301
+ return ( T ) ( object ) GetUInt32 ( ordinal ) ;
302
+ if ( typeof ( T ) == typeof ( long ) )
303
+ return ( T ) ( object ) GetInt64 ( ordinal ) ;
304
+ if ( typeof ( T ) == typeof ( ulong ) )
305
+ return ( T ) ( object ) GetUInt64 ( ordinal ) ;
306
+ if ( typeof ( T ) == typeof ( char ) )
307
+ return ( T ) ( object ) GetChar ( ordinal ) ;
308
+ if ( typeof ( T ) == typeof ( decimal ) )
309
+ return ( T ) ( object ) GetDecimal ( ordinal ) ;
310
+ if ( typeof ( T ) == typeof ( double ) )
311
+ return ( T ) ( object ) GetDouble ( ordinal ) ;
312
+ if ( typeof ( T ) == typeof ( float ) )
313
+ return ( T ) ( object ) GetFloat ( ordinal ) ;
314
+ if ( typeof ( T ) == typeof ( string ) )
315
+ return ( T ) ( object ) GetString ( ordinal ) ;
316
+ if ( typeof ( T ) == typeof ( DateTime ) )
317
+ return ( T ) ( object ) GetDateTime ( ordinal ) ;
288
318
if ( typeof ( T ) == typeof ( DateTimeOffset ) )
289
- return ( T ) Convert . ChangeType ( GetDateTimeOffset ( ordinal ) , typeof ( T ) ) ;
290
- if ( typeof ( T ) == typeof ( TextReader ) || typeof ( T ) == typeof ( StringReader ) )
291
- return ( T ) ( object ) GetTextReader ( ordinal ) ;
292
- if ( typeof ( T ) == typeof ( Stream ) )
293
- return ( T ) ( object ) GetStream ( ordinal ) ;
319
+ return ( T ) ( object ) GetDateTimeOffset ( ordinal ) ;
320
+ if ( typeof ( T ) == typeof ( Guid ) )
321
+ return ( T ) ( object ) GetGuid ( ordinal ) ;
294
322
if ( typeof ( T ) == typeof ( MySqlGeometry ) )
295
323
return ( T ) ( object ) GetMySqlGeometry ( ordinal ) ;
324
+ if ( typeof ( T ) == typeof ( Stream ) )
325
+ return ( T ) ( object ) GetStream ( ordinal ) ;
326
+ if ( typeof ( T ) == typeof ( TextReader ) || typeof ( T ) == typeof ( StringReader ) )
327
+ return ( T ) ( object ) GetTextReader ( ordinal ) ;
328
+ if ( typeof ( T ) == typeof ( TimeSpan ) )
329
+ return ( T ) ( object ) GetTimeSpan ( ordinal ) ;
296
330
297
331
return base . GetFieldValue < T > ( ordinal ) ;
298
332
}
0 commit comments