You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that the parameterName passed in must not be null or empty, but as long as a type matches, it will succeed. My expectation was that it would fail to bind if it couldn't find a parameter with the proper name AND type provided. Ninject seems to prefer Constructors with more dependencies, so it's possible you could attempt to override a parameter of one constructor with less parameters but will instead override the other that may contain a non-matching name.
For example:
public class FooFilter : IFooFilter
{
public FooFilter(IFoo f) { .. }
public FooFilter(IFoo foo, IBar bar) { .. }
}
Specifying a constructor parameter name of "f" will still prefer the latter constructor. The parameter name seems to be ignored.
The text was updated successfully, but these errors were encountered:
mikesmithphl
changed the title
Parameter name to WithConstructorArgumentFromControllerAttribute doesn't seem to be enforced
Parameter name to WithConstructorArgumentFromControllerAttribute is not enforced
Jul 19, 2016
Given the following code
I've found that the parameterName passed in must not be null or empty, but as long as a type matches, it will succeed. My expectation was that it would fail to bind if it couldn't find a parameter with the proper name AND type provided. Ninject seems to prefer Constructors with more dependencies, so it's possible you could attempt to override a parameter of one constructor with less parameters but will instead override the other that may contain a non-matching name.
For example:
Specifying a constructor parameter name of
"f"
will still prefer the latter constructor. The parameter name seems to be ignored.The text was updated successfully, but these errors were encountered: