11using System ;
2+ using System . Collections ;
23using System . Data ;
34using System . Data . Common ;
45
@@ -12,7 +13,7 @@ namespace NHibernate.AdoNet
1213 /// <seealso cref="IDataRecord.GetOrdinal"/>
1314 public class ResultSetWrapper : DbDataReader
1415 {
15- private readonly DbDataReader rs ;
16+ private DbDataReader rs ;
1617 private readonly ColumnNameCache columnNameCache ;
1718
1819 public ResultSetWrapper ( DbDataReader resultSet , ColumnNameCache columnNameCache )
@@ -26,206 +27,192 @@ internal DbDataReader Target
2627 get { return rs ; }
2728 }
2829
29- #region DbDataReader Members
30-
31- public void Close ( )
30+ public override void Close ( )
3231 {
3332 rs . Close ( ) ;
3433 }
3534
36- public DataTable GetSchemaTable ( )
35+ public override DataTable GetSchemaTable ( )
3736 {
3837 return rs . GetSchemaTable ( ) ;
3938 }
4039
41- public bool NextResult ( )
40+ public override bool NextResult ( )
4241 {
4342 return rs . NextResult ( ) ;
4443 }
4544
46- public bool Read ( )
45+ public override bool Read ( )
4746 {
4847 return rs . Read ( ) ;
4948 }
5049
51- public int Depth
50+ public override int Depth
5251 {
5352 get { return rs . Depth ; }
5453 }
5554
56- public bool IsClosed
55+ public override bool HasRows
5756 {
58- get { return rs . IsClosed ; }
57+ get { return rs . HasRows ; }
5958 }
6059
61- public int RecordsAffected
60+ public override bool IsClosed
6261 {
63- get { return rs . RecordsAffected ; }
62+ get { return rs . IsClosed ; }
6463 }
6564
66- #endregion
67-
68- #region IDisposable Members
69- private bool disposed ;
70-
71- ~ ResultSetWrapper ( )
65+ public override int RecordsAffected
7266 {
73- Dispose ( false ) ;
67+ get { return rs . RecordsAffected ; }
7468 }
7569
76- public void Dispose ( )
77- {
78- Dispose ( true ) ;
79- GC . SuppressFinalize ( this ) ;
80- }
70+ private bool disposed ;
8171
82- private void Dispose ( bool disposing )
72+ protected override void Dispose ( bool disposing )
8373 {
8474 if ( disposed )
8575 return ;
8676
87- if ( disposing )
77+ if ( disposing && rs != null )
8878 {
89- if ( rs != null )
90- {
91- if ( ! rs . IsClosed ) rs . Close ( ) ;
9279 rs . Dispose ( ) ;
80+ rs = null ;
9381 }
94- }
9582
9683 disposed = true ;
9784 }
98- #endregion
99-
100- #region IDataRecord Members
10185
102- public string GetName ( int i )
86+ public override string GetName ( int i )
10387 {
10488 return rs . GetName ( i ) ;
10589 }
10690
107- public string GetDataTypeName ( int i )
91+ public override string GetDataTypeName ( int i )
10892 {
10993 return rs . GetDataTypeName ( i ) ;
11094 }
11195
112- public System . Type GetFieldType ( int i )
96+ public override IEnumerator GetEnumerator ( )
97+ {
98+ return rs . GetEnumerator ( ) ;
99+ }
100+
101+ public override System . Type GetFieldType ( int i )
113102 {
114103 return rs . GetFieldType ( i ) ;
115104 }
116105
117- public object GetValue ( int i )
106+ public override object GetValue ( int i )
118107 {
119108 return rs . GetValue ( i ) ;
120109 }
121110
122- public int GetValues ( object [ ] values )
111+ public override int GetValues ( object [ ] values )
123112 {
124113 return rs . GetValues ( values ) ;
125114 }
126115
127- public int GetOrdinal ( string name )
116+ public override int GetOrdinal ( string name )
128117 {
129118 return columnNameCache . GetIndexForColumnName ( name , this ) ;
130119 }
131120
132- public bool GetBoolean ( int i )
121+ public override bool GetBoolean ( int i )
133122 {
134123 return rs . GetBoolean ( i ) ;
135124 }
136125
137- public byte GetByte ( int i )
126+ public override byte GetByte ( int i )
138127 {
139128 return rs . GetByte ( i ) ;
140129 }
141130
142- public long GetBytes ( int i , long fieldOffset , byte [ ] buffer , int bufferoffset , int length )
131+ public override long GetBytes ( int i , long fieldOffset , byte [ ] buffer , int bufferoffset , int length )
143132 {
144133 return rs . GetBytes ( i , fieldOffset , buffer , bufferoffset , length ) ;
145134 }
146135
147- public char GetChar ( int i )
136+ public override char GetChar ( int i )
148137 {
149138 return rs . GetChar ( i ) ;
150139 }
151140
152- public long GetChars ( int i , long fieldoffset , char [ ] buffer , int bufferoffset , int length )
141+ public override long GetChars ( int i , long fieldoffset , char [ ] buffer , int bufferoffset , int length )
153142 {
154143 return rs . GetChars ( i , fieldoffset , buffer , bufferoffset , length ) ;
155144 }
156145
157- public Guid GetGuid ( int i )
146+ public override Guid GetGuid ( int i )
158147 {
159148 return rs . GetGuid ( i ) ;
160149 }
161150
162- public short GetInt16 ( int i )
151+ public override short GetInt16 ( int i )
163152 {
164153 return rs . GetInt16 ( i ) ;
165154 }
166155
167- public int GetInt32 ( int i )
156+ public override int GetInt32 ( int i )
168157 {
169158 return rs . GetInt32 ( i ) ;
170159 }
171160
172- public long GetInt64 ( int i )
161+ public override long GetInt64 ( int i )
173162 {
174163 return rs . GetInt64 ( i ) ;
175164 }
176165
177- public float GetFloat ( int i )
166+ public override float GetFloat ( int i )
178167 {
179168 return rs . GetFloat ( i ) ;
180169 }
181170
182- public double GetDouble ( int i )
171+ public override double GetDouble ( int i )
183172 {
184173 return rs . GetDouble ( i ) ;
185174 }
186175
187- public string GetString ( int i )
176+ public override string GetString ( int i )
188177 {
189178 return rs . GetString ( i ) ;
190179 }
191180
192- public decimal GetDecimal ( int i )
181+ public override decimal GetDecimal ( int i )
193182 {
194183 return rs . GetDecimal ( i ) ;
195184 }
196185
197- public DateTime GetDateTime ( int i )
186+ public override DateTime GetDateTime ( int i )
198187 {
199188 return rs . GetDateTime ( i ) ;
200189 }
201190
202- public DbDataReader GetData ( int i )
191+ protected override DbDataReader GetDbDataReader ( int ordinal )
203192 {
204- return rs . GetData ( i ) ;
193+ return rs . GetData ( ordinal ) ;
205194 }
206195
207- public bool IsDBNull ( int i )
196+ public override bool IsDBNull ( int i )
208197 {
209198 return rs . IsDBNull ( i ) ;
210199 }
211200
212- public int FieldCount
201+ public override int FieldCount
213202 {
214203 get { return rs . FieldCount ; }
215204 }
216205
217- public object this [ int i ]
206+ public override object this [ int i ]
218207 {
219208 get { return rs [ i ] ; }
220209 }
221210
222- public object this [ string name ]
211+ public override object this [ string name ]
223212 {
224213 get { return rs [ columnNameCache . GetIndexForColumnName ( name , this ) ] ; }
225214 }
226215
227- #endregion
228-
229216 public override bool Equals ( object obj )
230217 {
231218 return rs . Equals ( obj ) ;
0 commit comments