Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DbDataReaderExtensions.cs
Go to the documentation of this file.
3
4namespace System.Data.Common;
5
6public static class DbDataReaderExtensions
7{
8 private sealed class DataRowDbColumn : DbColumn
9 {
11
12 private readonly DataRow _schemaRow;
13
20
21 private void PopulateFields()
22 {
36 base.IsIdentity = GetDbColumnValue<bool?>("IsIdentity");
43 base.UdtAssemblyQualifiedName = GetDbColumnValue<string>("UdtAssemblyQualifiedName");
45 base.DataTypeName = GetDbColumnValue<string>("DataTypeName");
46 }
47
49 {
51 {
52 object obj = _schemaRow[columnName];
53 if (obj is T)
54 {
55 return (T)obj;
56 }
57 }
58 return default(T);
59 }
60 }
61
63 {
64 if (reader == null)
65 {
66 throw new ArgumentNullException("reader");
67 }
69 {
70 return dbColumnSchemaGenerator.GetColumnSchema();
71 }
72 return GetColumnSchemaCompatibility(reader);
73 }
74
75 public static bool CanGetColumnSchema(this DbDataReader reader)
76 {
77 return true;
78 }
79
81 {
84 if (schemaTable != null)
85 {
87 foreach (DataRow row in schemaTable.Rows)
88 {
90 }
91 }
93 }
94}
void Add(TKey key, TValue value)
DataRowDbColumn(DataRow readerSchemaRow, DataColumnCollection readerSchemaColumns)
static ReadOnlyCollection< DbColumn > GetColumnSchema(this DbDataReader reader)
static bool CanGetColumnSchema(this DbDataReader reader)
static ReadOnlyCollection< DbColumn > GetColumnSchemaCompatibility(DbDataReader reader)
virtual ? DataTable GetSchemaTable()