File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
FirebirdSql.Data.FirebirdClient.Tests
FirebirdSql.Data.FirebirdClient/FirebirdClient Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,22 @@ public async Task NamedParametersReuseTest()
187
187
}
188
188
}
189
189
190
+ [ Test ]
191
+ public async Task NamedParametersPublicAccessor ( )
192
+ {
193
+ await using ( var command = new FbCommand ( "select * from test where int_field >= @x1 and int_field <= @x2" , Connection ) )
194
+ {
195
+ Assert . IsNotNull ( command . NamedParameters , "Unexpected null reference." ) ;
196
+ Assert . IsTrue ( command . NamedParameters . Count == 0 , "Expected count 0 of named parameters before command prepare." ) ;
197
+
198
+ await command . PrepareAsync ( ) ;
199
+
200
+ Assert . IsTrue ( command . NamedParameters . Count == 2 , "Expected count 2 of named parameters after command prepare." ) ;
201
+ Assert . AreEqual ( command . NamedParameters [ 0 ] , "@x1" ) ;
202
+ Assert . AreEqual ( command . NamedParameters [ 1 ] , "@x2" ) ;
203
+ }
204
+ }
205
+
190
206
[ Test ]
191
207
public async Task ExecuteStoredProcTest ( )
192
208
{
Original file line number Diff line number Diff line change @@ -192,6 +192,16 @@ public int BatchBufferSize
192
192
}
193
193
}
194
194
195
+ /// <summary>
196
+ /// Gets collection of parameters parsed from the query text during command prepare.
197
+ /// </summary>
198
+ [ Browsable ( false ) ]
199
+ [ DesignerSerializationVisibility ( DesignerSerializationVisibility . Hidden ) ]
200
+ public IReadOnlyList< string > NamedParameters
201
+ {
202
+ get { return _namedParameters; }
203
+ }
204
+
195
205
#endregion
196
206
197
207
#region Internal Properties
Original file line number Diff line number Diff line change @@ -198,6 +198,16 @@ public int FetchSize
198
198
}
199
199
}
200
200
201
+ /// <summary>
202
+ /// Gets collection of parameters parsed from the query text during command prepare.
203
+ /// </summary>
204
+ [ Browsable ( false ) ]
205
+ [ DesignerSerializationVisibility ( DesignerSerializationVisibility . Hidden ) ]
206
+ public IReadOnlyList < string > NamedParameters
207
+ {
208
+ get { return _namedParameters ; }
209
+ }
210
+
201
211
#endregion
202
212
203
213
#region Protected DbCommand Properties
You can’t perform that action at this time.
0 commit comments