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

Fix incorrect exception argument in DbConnectionOptions #98826

Closed
wants to merge 1 commit into from

Conversation

sebastienros
Copy link
Member

No description provided.

@ghost ghost assigned sebastienros Feb 22, 2024
@@ -190,7 +190,7 @@ internal static void ValidateKeyValuePair(string keyword, string value)
}
if ((null != value) && value.Contains('\0'))
{
throw ADP.InvalidValue(keyword);
throw ADP.InvalidValue(value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why does this need to change to value? The argument here is the parameter name, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually considering that it should be nameof(value). It's expecting the parameter name, returning an ArgumentException.

https://source.dot.net/#System.Data.Common/System/Data/Common/AdapterUtil.Common.cs,723f78a5c15d5418,references

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you mean that the value of keyword should be the parameter name since it's triggered when setting the indexer and it is meant to show this as the source

https://source.dot.net/#System.Data.Common/System/Data/Common/DbConnectionStringBuilder.cs,98

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you mean that the value of keyword should be the parameter name since it's triggered when setting the indexer and it is meant to show this as the source

https://source.dot.net/#System.Data.Common/System/Data/Common/DbConnectionStringBuilder.cs,98

Right, I suspect that was the original intent.

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

Successfully merging this pull request may close these issues.

2 participants