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

Public Factory Method for Rule Parameter From Type #529

Merged

Conversation

cmeyertons
Copy link
Contributor

If the RuleParameter's type is only known via a Type at runtime, it becomes non-trivial to create a pseudo-object of that Type in order to create a RuleParameter. For instance, Activator.CreateInstance throws when attempting to create a string

It would be ideal if the RuleParameter could be created directly from the Name and Type pair as the internal implementation does.

In this PR, I elected to create a static factory method over publicizing the constructor to avoid overload confusion of Name, Value and Name, Type - theoretically a consumer could be passing in a Type into the object constructor, and publicizing the constructor could potentially be a breaking change.

@YogeshPraj YogeshPraj merged commit 6a747b3 into microsoft:main Aug 23, 2024
4 checks passed
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.

2 participants