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()
187187 }
188188 }
189189
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+
190206 [ Test ]
191207 public async Task ExecuteStoredProcTest ( )
192208 {
Original file line number Diff line number Diff line change @@ -192,6 +192,16 @@ public int BatchBufferSize
192192 }
193193 }
194194
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+
195205 #endregion
196206
197207 #region Internal Properties
Original file line number Diff line number Diff line change @@ -198,6 +198,16 @@ public int FetchSize
198198 }
199199 }
200200
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+
201211 #endregion
202212
203213 #region Protected DbCommand Properties
You can’t perform that action at this time.
0 commit comments