-
Notifications
You must be signed in to change notification settings - Fork 0
/
DbConnectionProfiler.cs
1420 lines (1272 loc) · 43.1 KB
/
DbConnectionProfiler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading;
namespace DbConnectionProfiler
{
//REF: https://github.com/MiniProfiler/dotnet
public interface IDbProfiler
{
bool IsActive { get; set; }
void ExecuteStart(ProfiledDbCommand profiledDbCommand, SqlExecuteType executeType);
void OnError(ProfiledDbCommand profiledDbCommand, SqlExecuteType nonQuery, Exception exception);
void ReaderFinish(ProfiledDbDataReader profiledDbDataReader);
void ExecuteFinish(ProfiledDbCommand profiledDbCommand, SqlExecuteType executeType, DbDataReader reader);
}
public class DbProfiler : IDbProfiler
{
private static IDbProfiler _current;
public static IDbProfiler Current
{
get { return _current ?? (_current = new DbProfiler { IsActive = true }); }
}
public bool IsActive { get; set; }
public void ExecuteStart(ProfiledDbCommand profiledDbCommand, SqlExecuteType executeType)
{
}
public void OnError(ProfiledDbCommand profiledDbCommand, SqlExecuteType nonQuery, Exception exception)
{
}
public void ReaderFinish(ProfiledDbDataReader profiledDbDataReader)
{
}
public void ExecuteFinish(ProfiledDbCommand profiledDbCommand, SqlExecuteType executeType, DbDataReader reader)
{
#if DEBUG
System.Diagnostics.Debug.Print(GetCommandText(profiledDbCommand));
#endif
}
public static IDbConnection Wrap(DbConnection conn)
{
#if DEBUG
return new ProfiledDbConnection(conn, Current);
#else
return conn;
#endif
}
private static string GetCommandText(IDbCommand cmd)
{
var prms = cmd.Parameters.Cast<SqlParameter>().ToList();
var builder = new StringBuilder();
// StoredProcedure
if (cmd.CommandType == CommandType.StoredProcedure)
{
var result = prms.FirstOrDefault(x => x.Direction == ParameterDirection.ReturnValue);
if (result != null)
{
builder.AppendLine("DECLARE @" + result.ParameterName + " " + result.SqlDbType);
builder.Append("EXEC @" + result.ParameterName + " = " + cmd.CommandText);
}
else
{
builder.Append("EXEC " + cmd.CommandText);
}
var args = new List<string>();
foreach (var prm in prms)
{
if (prm.Direction != ParameterDirection.Input && prm.Direction != ParameterDirection.InputOutput)
continue;
args.Add(string.Format(" @{0}={1}", prm.ParameterName, GetParameterValue(prm)));
}
builder.Append(string.Join(",", args));
if (result != null)
{
builder.AppendLine();
builder.AppendLine("SELECT @" + result.ParameterName);
}
}
// Sql
else
{
var sql = cmd.CommandText;
for (var i = 0; i < prms.Count; i++)
{
sql = sql.Replace(prms[i].ParameterName, GetParameterValue(prms[i]));
}
builder.Append(sql);
}
return builder.ToString();
}
private static string GetParameterValue(SqlParameter prm)
{
if ((prm.SqlValue is INullable) && ((INullable)prm.SqlValue).IsNull)
{
return "NULL";
}
if (prm.SqlValue is SqlString || prm.SqlValue is SqlDateTime)
{
return "'" + prm.Value + "'";
}
return prm.Value + "";
}
};
/// <summary>
/// Wraps a database connection, allowing SQL execution timings to be collected when a DbProfiler session is started.
/// </summary>
[System.ComponentModel.DesignerCategory("")]
public class ProfiledDbConnection : DbConnection, ICloneable
{
/// <summary>
/// Gets the underlying, real database connection to your database provider.
/// </summary>
public DbConnection InnerConnection { get; private set; }
/// <summary>
/// Gets the current profiler instance; could be null.
/// </summary>
public IDbProfiler DbProfiler { get; private set; }
/// <summary>
/// Initialises a new instance of the <see cref="ProfiledDbConnection"/> class.
/// Returns a new <see cref="ProfiledDbConnection"/> that wraps <paramref name="connection"/>,
/// providing query execution profiling. If profiler is null, no profiling will occur.
/// </summary>
/// <param name="connection">
/// <c>Your provider-specific flavour of connection, e.g. SqlConnection, OracleConnection</c>
/// </param>
/// <param name="profiler">
/// The currently started DbProfiler or null.
/// </param>
public ProfiledDbConnection(DbConnection connection, IDbProfiler profiler)
{
if (connection == null) throw new ArgumentNullException("connection");
InnerConnection = connection;
InnerConnection.StateChange += StateChangeHandler;
if (profiler != null)
{
DbProfiler = profiler;
}
}
/// <summary>
/// Gets the wrapped connection.
/// </summary>
public DbConnection WrappedConnection
{
get { return InnerConnection; }
}
/// <summary>
/// Gets a value indicating whether events can be raised.
/// </summary>
protected override bool CanRaiseEvents
{
get { return true; }
}
/// <summary>
/// Gets or sets the connection string.
/// </summary>
public override string ConnectionString
{
get { return InnerConnection.ConnectionString; }
set { InnerConnection.ConnectionString = value; }
}
/// <summary>
/// Gets the connection timeout.
/// </summary>
public override int ConnectionTimeout
{
get { return InnerConnection.ConnectionTimeout; }
}
/// <summary>
/// Gets the database.
/// </summary>
public override string Database
{
get { return InnerConnection.Database; }
}
/// <summary>
/// Gets the data source.
/// </summary>
public override string DataSource
{
get { return InnerConnection.DataSource; }
}
/// <summary>
/// Gets the server version.
/// </summary>
public override string ServerVersion
{
get { return InnerConnection.ServerVersion; }
}
/// <summary>
/// Gets the state.
/// </summary>
public override ConnectionState State
{
get { return InnerConnection.State; }
}
/// <summary>
/// change the database.
/// </summary>
/// <param name="databaseName">The new database name.</param>
public override void ChangeDatabase(string databaseName)
{
InnerConnection.ChangeDatabase(databaseName);
}
/// <summary>
/// close the connection.
/// </summary>
public override void Close()
{
InnerConnection.Close();
}
/// <summary>
/// enlist the transaction.
/// </summary>
/// <param name="transaction">The transaction.</param>
public override void EnlistTransaction(System.Transactions.Transaction transaction)
{
InnerConnection.EnlistTransaction(transaction);
}
/// <summary>
/// get the schema.
/// </summary>
/// <returns>The <see cref="DataTable"/>.</returns>
public override DataTable GetSchema()
{
return InnerConnection.GetSchema();
}
/// <summary>
/// get the schema.
/// </summary>
/// <param name="collectionName">The collection name.</param>
/// <returns>The <see cref="DataTable"/>.</returns>
public override DataTable GetSchema(string collectionName)
{
return InnerConnection.GetSchema(collectionName);
}
/// <summary>
/// get the schema.
/// </summary>
/// <param name="collectionName">The collection name.</param>
/// <param name="restrictionValues">The restriction values.</param>
/// <returns>The <see cref="DataTable"/>.</returns>
public override DataTable GetSchema(string collectionName, string[] restrictionValues)
{
return InnerConnection.GetSchema(collectionName, restrictionValues);
}
/// <summary>
/// open the connection
/// </summary>
public override void Open()
{
InnerConnection.Open();
}
/// <summary>
/// begin the database transaction.
/// </summary>
/// <param name="isolationLevel">The isolation level.</param>
/// <returns>The <see cref="DbTransaction"/>.</returns>
protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
{
return new ProfiledDbTransaction(InnerConnection.BeginTransaction(isolationLevel), this);
}
/// <summary>
/// create the database command.
/// </summary>
/// <returns>The <see cref="DbCommand"/>.</returns>
protected override DbCommand CreateDbCommand()
{
return new ProfiledDbCommand(InnerConnection.CreateCommand(), this, DbProfiler);
}
/// <summary>
/// dispose the underlying connection.
/// </summary>
/// <param name="disposing">false if pre-empted from a <c>finalizer</c></param>
protected override void Dispose(bool disposing)
{
if (disposing && InnerConnection != null)
{
InnerConnection.StateChange -= StateChangeHandler;
InnerConnection.Dispose();
}
InnerConnection = null;
DbProfiler = null;
base.Dispose(disposing);
}
/// <summary>
/// The state change handler.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="stateChangeEventArguments">The state change event arguments.</param>
private void StateChangeHandler(object sender, StateChangeEventArgs stateChangeEventArguments)
{
OnStateChange(stateChangeEventArguments);
}
/// <summary>
/// create a clone.
/// </summary>
/// <returns>The <see cref="ProfiledDbConnection"/>.</returns>
public ProfiledDbConnection Clone()
{
var tail = InnerConnection as ICloneable;
if (tail == null)
throw new NotSupportedException("Underlying " + InnerConnection.GetType().Name + " is not cloneable");
return new ProfiledDbConnection((DbConnection)tail.Clone(), DbProfiler);
}
/// <summary>
/// create a clone.
/// </summary>
/// <returns>The <see cref="object"/>.</returns>
object ICloneable.Clone()
{
return Clone();
}
};
/// <summary>
/// Categories of SQL statements.
/// </summary>
public enum SqlExecuteType : byte
{
/// <summary>
/// Unknown type
/// </summary>
None = 0,
/// <summary>
/// DML statements that alter database state, e.g. INSERT, UPDATE
/// </summary>
NonQuery = 1,
/// <summary>
/// Statements that return a single record
/// </summary>
Scalar = 2,
/// <summary>
/// Statements that iterate over a result set
/// </summary>
Reader = 3
}
/// <summary>
/// The profiled database transaction.
/// </summary>
public class ProfiledDbTransaction : DbTransaction
{
/// <summary>
/// The connection.
/// </summary>
private ProfiledDbConnection _connection;
/// <summary>
/// The transaction.
/// </summary>
private DbTransaction _transaction;
/// <summary>
/// Initialises a new instance of the <see cref="ProfiledDbTransaction"/> class.
/// </summary>
/// <param name="transaction">The transaction.</param>
/// <param name="connection">The connection.</param>
public ProfiledDbTransaction(DbTransaction transaction, ProfiledDbConnection connection)
{
if (transaction == null) throw new ArgumentNullException("transaction");
if (connection == null) throw new ArgumentNullException("connection");
_transaction = transaction;
_connection = connection;
}
/// <summary>
/// Gets the database connection.
/// </summary>
protected override DbConnection DbConnection
{
get { return _connection; }
}
/// <summary>
/// Gets the wrapped transaction.
/// </summary>
public DbTransaction WrappedTransaction
{
get { return _transaction; }
}
/// <summary>
/// Gets the isolation level.
/// </summary>
public override IsolationLevel IsolationLevel
{
get { return _transaction.IsolationLevel; }
}
/// <summary>
/// commit the transaction.
/// </summary>
public override void Commit()
{
_transaction.Commit();
}
/// <summary>
/// rollback the transaction
/// </summary>
public override void Rollback()
{
_transaction.Rollback();
}
/// <summary>
/// dispose the transaction and connection.
/// </summary>
/// <param name="disposing">false if being called from a <c>finalizer</c></param>
protected override void Dispose(bool disposing)
{
if (disposing && _transaction != null)
{
_transaction.Dispose();
}
_transaction = null;
_connection = null;
base.Dispose(disposing);
}
};
/// <summary>
/// This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example),
/// and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE**
/// equality. The type is fully thread-safe.
/// </summary>
/// <typeparam name="TKey">the key type</typeparam>
/// <typeparam name="TValue">the value type</typeparam>
public class Link<TKey, TValue> where TKey : class
{
/// <summary>
/// Initialises a new instance of the <see cref="Link{TKey,TValue}"/> class.
/// </summary>
/// <param name="key">
/// The key.
/// </param>
/// <param name="value">
/// The value.
/// </param>
/// <param name="tail">
/// The tail.
/// </param>
private Link(TKey key, TValue value, Link<TKey, TValue> tail)
{
Key = key;
Value = value;
Tail = tail;
}
/// <summary>
/// Gets the key.
/// </summary>
public TKey Key { get; private set; }
/// <summary>
/// Gets the value.
/// </summary>
public TValue Value { get; private set; }
/// <summary>
/// Gets the tail.
/// </summary>
public Link<TKey, TValue> Tail { get; private set; }
/// <summary>
/// try and return a value from the cache based on the key.
/// the default value is returned if no match is found.
/// An exception is not thrown.
/// </summary>
/// <param name="link">The link.</param>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
/// <returns>return true if a value is located.</returns>
public static bool TryGet(Link<TKey, TValue> link, TKey key, out TValue value)
{
while (link != null)
{
if ((object)key == (object)link.Key)
{
value = link.Value;
return true;
}
link = link.Tail;
}
value = default(TValue);
return false;
}
/// <summary>
/// try and return a value from the cache based on the key.
/// the default value is returned if no match is found.
/// An exception is not thrown.
/// </summary>
/// <param name="head">The head.</param>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
/// <returns>return true if a value is located</returns>
public static bool TryAdd(ref Link<TKey, TValue> head, TKey key, ref TValue value)
{
bool tryAgain;
do
{
var snapshot = Interlocked.CompareExchange(ref head, null, null);
TValue found;
if (TryGet(snapshot, key, out found))
{
// existing match; report the existing value instead
value = found;
return false;
}
var newNode = new Link<TKey, TValue>(key, value, snapshot);
// did somebody move our cheese?
tryAgain = Interlocked.CompareExchange(ref head, newNode, snapshot) != snapshot;
} while (tryAgain);
return true;
}
};
/// <summary>
/// The profiled database data reader.
/// </summary>
public class ProfiledDbDataReader : DbDataReader
{
/// <summary>
/// The _reader.
/// </summary>
private readonly DbDataReader _reader;
/// <summary>
/// The _profiler.
/// </summary>
private readonly IDbProfiler _profiler;
/// <summary>
/// Initialises a new instance of the <see cref="ProfiledDbDataReader"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="connection">The connection.</param>
/// <param name="profiler">The profiler.</param>
public ProfiledDbDataReader(DbDataReader reader, DbConnection connection, IDbProfiler profiler)
{
_reader = reader;
if (profiler != null)
{
_profiler = profiler;
}
}
/// <summary>
/// Gets the depth.
/// </summary>
public override int Depth
{
get { return _reader.Depth; }
}
/// <summary>
/// Gets the field count.
/// </summary>
public override int FieldCount
{
get { return _reader.FieldCount; }
}
/// <summary>
/// Gets a value indicating whether has rows.
/// </summary>
public override bool HasRows
{
get { return _reader.HasRows; }
}
/// <summary>
/// Gets a value indicating whether is closed.
/// </summary>
public override bool IsClosed
{
get { return _reader.IsClosed; }
}
/// <summary>
/// Gets the records affected.
/// </summary>
public override int RecordsAffected
{
get { return _reader.RecordsAffected; }
}
/// <summary>
/// The
/// </summary>
/// <param name="name">
/// The name.
/// </param>
/// <returns>
/// The <see cref="object"/>.
/// </returns>
public override object this[string name]
{
get { return _reader[name]; }
}
/// <summary>
/// The
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="object"/>.
/// </returns>
public override object this[int ordinal]
{
get { return _reader[ordinal]; }
}
/// <summary>
/// The close.
/// </summary>
public override void Close()
{
// this can occur when we're not profiling, but we've inherited from ProfiledDbCommand and are returning a
// an unwrapped reader from the base command
if (_reader != null)
{
_reader.Close();
}
if (_profiler != null)
{
_profiler.ReaderFinish(this);
}
}
/// <summary>
/// The get boolean.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="bool"/>.
/// </returns>
public override bool GetBoolean(int ordinal)
{
return _reader.GetBoolean(ordinal);
}
/// <summary>
/// The get byte.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="byte"/>.
/// </returns>
public override byte GetByte(int ordinal)
{
return _reader.GetByte(ordinal);
}
/// <summary>
/// The get bytes.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <param name="dataOffset">
/// The data offset.
/// </param>
/// <param name="buffer">
/// The buffer.
/// </param>
/// <param name="bufferOffset">
/// The buffer offset.
/// </param>
/// <param name="length">
/// The length.
/// </param>
/// <returns>
/// The <see cref="long"/>.
/// </returns>
public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
{
return _reader.GetBytes(ordinal, dataOffset, buffer, bufferOffset, length);
}
/// <summary>
/// The get char.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="char"/>.
/// </returns>
public override char GetChar(int ordinal)
{
return _reader.GetChar(ordinal);
}
/// <summary>
/// The get chars.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <param name="dataOffset">
/// The data offset.
/// </param>
/// <param name="buffer">
/// The buffer.
/// </param>
/// <param name="bufferOffset">
/// The buffer offset.
/// </param>
/// <param name="length">
/// The length.
/// </param>
/// <returns>
/// The <see cref="long"/>.
/// </returns>
public override long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length)
{
return _reader.GetChars(ordinal, dataOffset, buffer, bufferOffset, length);
}
/// <summary>
/// The get data type name.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="string"/>.
/// </returns>
public override string GetDataTypeName(int ordinal)
{
return _reader.GetDataTypeName(ordinal);
}
/// <summary>
/// The get date time.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="DateTime"/>.
/// </returns>
public override DateTime GetDateTime(int ordinal)
{
return _reader.GetDateTime(ordinal);
}
/// <summary>
/// The get decimal.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="decimal"/>.
/// </returns>
public override decimal GetDecimal(int ordinal)
{
return _reader.GetDecimal(ordinal);
}
/// <summary>
/// The get double.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="double"/>.
/// </returns>
public override double GetDouble(int ordinal)
{
return _reader.GetDouble(ordinal);
}
/// <summary>
/// The get enumerator.
/// </summary>
public override System.Collections.IEnumerator GetEnumerator()
{
return ((System.Collections.IEnumerable)_reader).GetEnumerator();
}
/// <summary>
/// The get field type.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="Type"/>.
/// </returns>
public override Type GetFieldType(int ordinal)
{
return _reader.GetFieldType(ordinal);
}
/// <summary>
/// The get float.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="float"/>.
/// </returns>
public override float GetFloat(int ordinal)
{
return _reader.GetFloat(ordinal);
}
/// <summary>
/// get the GUID.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="Guid"/>.
/// </returns>
public override Guid GetGuid(int ordinal)
{
return _reader.GetGuid(ordinal);
}
/// <summary>
/// The get integer.
/// </summary>
/// <param name="ordinal">The ordinal.</param>
/// <returns>The <see cref="short"/>.</returns>
public override short GetInt16(int ordinal)
{
return _reader.GetInt16(ordinal);
}
/// <summary>
/// get a 32 bit integer
/// </summary>
/// <param name="ordinal">The ordinal.</param>
/// <returns>
/// The <see cref="int"/>.
/// </returns>
public override int GetInt32(int ordinal)
{
return _reader.GetInt32(ordinal);
}
/// <summary>
/// get a 64 bit integer (long)
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="long"/>.
/// </returns>
public override long GetInt64(int ordinal)
{
return _reader.GetInt64(ordinal);
}
/// <summary>
/// The get name.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="string"/>.
/// </returns>
public override string GetName(int ordinal)
{
return _reader.GetName(ordinal);
}
/// <summary>
/// The get ordinal.
/// </summary>
/// <param name="name">
/// The name.
/// </param>
/// <returns>
/// The <see cref="int"/>.
/// </returns>
public override int GetOrdinal(string name)
{
return _reader.GetOrdinal(name);
}
/// <summary>
/// The get schema table.
/// </summary>
/// <returns>
/// The <see cref="DataTable"/>.
/// </returns>
public override DataTable GetSchemaTable()
{
return _reader.GetSchemaTable();
}
/// <summary>
/// The get string.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="string"/>.
/// </returns>
public override string GetString(int ordinal)
{
return _reader.GetString(ordinal);
}
/// <summary>
/// The get value.
/// </summary>
/// <param name="ordinal">
/// The ordinal.
/// </param>
/// <returns>
/// The <see cref="object"/>.
/// </returns>
public override object GetValue(int ordinal)
{
return _reader.GetValue(ordinal);
}
/// <summary>
/// The get values.
/// </summary>
/// <param name="values">
/// The values.