@@ -12,7 +12,7 @@ namespace NHibernate.AdoNet
12
12
/// <seealso cref="IDataRecord.GetOrdinal"/>
13
13
public class ResultSetWrapper : DbDataReader
14
14
{
15
- private readonly DbDataReader rs ;
15
+ private DbDataReader rs ;
16
16
private readonly ColumnNameCache columnNameCache ;
17
17
18
18
public ResultSetWrapper ( DbDataReader resultSet , ColumnNameCache columnNameCache )
@@ -26,206 +26,192 @@ internal DbDataReader Target
26
26
get { return rs ; }
27
27
}
28
28
29
- #region DbDataReader Members
30
-
31
- public void Close ( )
29
+ public override void Close ( )
32
30
{
33
31
rs . Close ( ) ;
34
32
}
35
33
36
- public DataTable GetSchemaTable ( )
34
+ public override DataTable GetSchemaTable ( )
37
35
{
38
36
return rs . GetSchemaTable ( ) ;
39
37
}
40
38
41
- public bool NextResult ( )
39
+ public override bool NextResult ( )
42
40
{
43
41
return rs . NextResult ( ) ;
44
42
}
45
43
46
- public bool Read ( )
44
+ public override bool Read ( )
47
45
{
48
46
return rs . Read ( ) ;
49
47
}
50
48
51
- public int Depth
49
+ public override int Depth
52
50
{
53
51
get { return rs . Depth ; }
54
52
}
55
53
56
- public bool IsClosed
54
+ public override bool HasRows
57
55
{
58
- get { return rs . IsClosed ; }
56
+ get { return rs . HasRows ; }
59
57
}
60
58
61
- public int RecordsAffected
59
+ public override bool IsClosed
62
60
{
63
- get { return rs . RecordsAffected ; }
61
+ get { return rs . IsClosed ; }
64
62
}
65
63
66
- #endregion
67
-
68
- #region IDisposable Members
69
- private bool disposed ;
70
-
71
- ~ ResultSetWrapper ( )
64
+ public override int RecordsAffected
72
65
{
73
- Dispose ( false ) ;
66
+ get { return rs . RecordsAffected ; }
74
67
}
75
68
76
- public void Dispose ( )
77
- {
78
- Dispose ( true ) ;
79
- GC . SuppressFinalize ( this ) ;
80
- }
69
+ private bool disposed ;
81
70
82
- private void Dispose ( bool disposing )
71
+ protected override void Dispose ( bool disposing )
83
72
{
84
73
if ( disposed )
85
74
return ;
86
75
87
- if ( disposing )
76
+ if ( disposing && rs != null )
88
77
{
89
- if ( rs != null )
90
- {
91
- if ( ! rs . IsClosed ) rs . Close ( ) ;
92
78
rs . Dispose ( ) ;
79
+ rs = null ;
93
80
}
94
- }
95
81
96
82
disposed = true ;
97
83
}
98
- #endregion
99
-
100
- #region IDataRecord Members
101
84
102
- public string GetName ( int i )
85
+ public override string GetName ( int i )
103
86
{
104
87
return rs . GetName ( i ) ;
105
88
}
106
89
107
- public string GetDataTypeName ( int i )
90
+ public override string GetDataTypeName ( int i )
108
91
{
109
92
return rs . GetDataTypeName ( i ) ;
110
93
}
111
94
112
- public System . Type GetFieldType ( int i )
95
+ public override IEnumerator GetEnumerator ( )
96
+ {
97
+ return rs . GetEnumerator ( ) ;
98
+ }
99
+
100
+ public override System . Type GetFieldType ( int i )
113
101
{
114
102
return rs . GetFieldType ( i ) ;
115
103
}
116
104
117
- public object GetValue ( int i )
105
+ public override object GetValue ( int i )
118
106
{
119
107
return rs . GetValue ( i ) ;
120
108
}
121
109
122
- public int GetValues ( object [ ] values )
110
+ public override int GetValues ( object [ ] values )
123
111
{
124
112
return rs . GetValues ( values ) ;
125
113
}
126
114
127
- public int GetOrdinal ( string name )
115
+ public override int GetOrdinal ( string name )
128
116
{
129
117
return columnNameCache . GetIndexForColumnName ( name , this ) ;
130
118
}
131
119
132
- public bool GetBoolean ( int i )
120
+ public override bool GetBoolean ( int i )
133
121
{
134
122
return rs . GetBoolean ( i ) ;
135
123
}
136
124
137
- public byte GetByte ( int i )
125
+ public override byte GetByte ( int i )
138
126
{
139
127
return rs . GetByte ( i ) ;
140
128
}
141
129
142
- public long GetBytes ( int i , long fieldOffset , byte [ ] buffer , int bufferoffset , int length )
130
+ public override long GetBytes ( int i , long fieldOffset , byte [ ] buffer , int bufferoffset , int length )
143
131
{
144
132
return rs . GetBytes ( i , fieldOffset , buffer , bufferoffset , length ) ;
145
133
}
146
134
147
- public char GetChar ( int i )
135
+ public override char GetChar ( int i )
148
136
{
149
137
return rs . GetChar ( i ) ;
150
138
}
151
139
152
- public long GetChars ( int i , long fieldoffset , char [ ] buffer , int bufferoffset , int length )
140
+ public override long GetChars ( int i , long fieldoffset , char [ ] buffer , int bufferoffset , int length )
153
141
{
154
142
return rs . GetChars ( i , fieldoffset , buffer , bufferoffset , length ) ;
155
143
}
156
144
157
- public Guid GetGuid ( int i )
145
+ public override Guid GetGuid ( int i )
158
146
{
159
147
return rs . GetGuid ( i ) ;
160
148
}
161
149
162
- public short GetInt16 ( int i )
150
+ public override short GetInt16 ( int i )
163
151
{
164
152
return rs . GetInt16 ( i ) ;
165
153
}
166
154
167
- public int GetInt32 ( int i )
155
+ public override int GetInt32 ( int i )
168
156
{
169
157
return rs . GetInt32 ( i ) ;
170
158
}
171
159
172
- public long GetInt64 ( int i )
160
+ public override long GetInt64 ( int i )
173
161
{
174
162
return rs . GetInt64 ( i ) ;
175
163
}
176
164
177
- public float GetFloat ( int i )
165
+ public override float GetFloat ( int i )
178
166
{
179
167
return rs . GetFloat ( i ) ;
180
168
}
181
169
182
- public double GetDouble ( int i )
170
+ public override double GetDouble ( int i )
183
171
{
184
172
return rs . GetDouble ( i ) ;
185
173
}
186
174
187
- public string GetString ( int i )
175
+ public override string GetString ( int i )
188
176
{
189
177
return rs . GetString ( i ) ;
190
178
}
191
179
192
- public decimal GetDecimal ( int i )
180
+ public override decimal GetDecimal ( int i )
193
181
{
194
182
return rs . GetDecimal ( i ) ;
195
183
}
196
184
197
- public DateTime GetDateTime ( int i )
185
+ public override DateTime GetDateTime ( int i )
198
186
{
199
187
return rs . GetDateTime ( i ) ;
200
188
}
201
189
202
- public DbDataReader GetData ( int i )
190
+ protected override DbDataReader GetDbDataReader ( int ordinal )
203
191
{
204
- return rs . GetData ( i ) ;
192
+ return rs . GetData ( ordinal ) ;
205
193
}
206
194
207
- public bool IsDBNull ( int i )
195
+ public override bool IsDBNull ( int i )
208
196
{
209
197
return rs . IsDBNull ( i ) ;
210
198
}
211
199
212
- public int FieldCount
200
+ public override int FieldCount
213
201
{
214
202
get { return rs . FieldCount ; }
215
203
}
216
204
217
- public object this [ int i ]
205
+ public override object this [ int i ]
218
206
{
219
207
get { return rs [ i ] ; }
220
208
}
221
209
222
- public object this [ string name ]
210
+ public override object this [ string name ]
223
211
{
224
212
get { return rs [ columnNameCache . GetIndexForColumnName ( name , this ) ] ; }
225
213
}
226
214
227
- #endregion
228
-
229
215
public override bool Equals ( object obj )
230
216
{
231
217
return rs . Equals ( obj ) ;
0 commit comments