Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add property FbCommand.NamedParameters (FirebirdSQL#1161) #1168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
cincuranet merged 1 commit into FirebirdSQL:master from dant02:master
Apr 14, 2024
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
View file Open in desktop
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
View file Open in desktop
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
View file Open in desktop
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

AltStyle によって変換されたページ (->オリジナル) /