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.
If the
RuleParameter
's type is only known via aType
at runtime, it becomes non-trivial to create a pseudo-object of thatType
in order to create aRuleParameter
. For instance,Activator.CreateInstance
throws when attempting to create astring
It would be ideal if the
RuleParameter
could be created directly from theName
andType
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
andName, Type
- theoretically a consumer could be passing in aType
into theobject
constructor, and publicizing the constructor could potentially be a breaking change.