Skip to content
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

Fixes incorrect cast of parameters in CommandBuilder #3015

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gehongyan
Copy link
Contributor

Description

In CommandBuidler, the AddParameters expects an array of TParamBuidler.

/// <summary>
/// Adds parameter builders to <see cref="Parameters"/>.
/// </summary>
/// <param name="parameters">New parameter builders to be added to <see cref="Parameters"/>.</param>
/// <returns>
/// The builder instance.
/// </returns>
public TBuilder AddParameters(params TParamBuilder[] parameters)
{
_parameters.AddRange(parameters);
return Instance;
}

In the explicit implementation of ICommandBuilder.AddParameters, the parameters of type IParameterBuilder[] should be cast to TParamBuilder[] array instead of a single TParamBuilder.

/// <inheritdoc/>
ICommandBuilder ICommandBuilder.AddParameters(params IParameterBuilder[] parameters) =>
AddParameters(parameters as TParamBuilder);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant