Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ public async Task NamedParametersReuseTest()
}
}

[Test]
public async Task NamedParametersPublicAccessor()
{
await using (var command = new FbCommand("select * from test where int_field >= @x1 and int_field <= @x2", Connection))
{
Assert.IsNotNull(command.NamedParameters, "Unexpected null reference.");
Assert.IsTrue(command.NamedParameters.Count == 0, "Expected count 0 of named parameters before command prepare.");

await command.PrepareAsync();

Assert.IsTrue(command.NamedParameters.Count == 2, "Expected count 2 of named parameters after command prepare.");
Assert.AreEqual(command.NamedParameters[0], "@x1");
Assert.AreEqual(command.NamedParameters[1], "@x2");
}
}

[Test]
public async Task ExecuteStoredProcTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ public int BatchBufferSize
}
}

/// <summary>
/// Gets collection of parameters parsed from the query text during command prepare.
/// </summary>
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IReadOnlyList<string> NamedParameters
{
get { return _namedParameters; }
}

#endregion

#region Internal Properties
Expand Down
10 changes: 10 additions & 0 deletions src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ public int FetchSize
}
}

/// <summary>
/// Gets collection of parameters parsed from the query text during command prepare.
/// </summary>
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IReadOnlyList<string> NamedParameters
{
get { return _namedParameters; }
}

#endregion

#region Protected DbCommand Properties
Expand Down