Mugen Injection [Passing parameters]
All methods to resolve accepts parameters using a variable-length argument list. This will map automatically to the named constructor parameters on the implementation class, if it was registered using Reflection, e.g.:
public class Alpha { public Alpha(string test) { } } var alpha = _injector.Get<Alpha>(new ConstructorParameter("test", "test")); var enumerable = _injector.GetAll<Alpha>(new ConstructorParameter("test", "test"));
Available parameter types
All parameters implements the IInjectionParameter interface and you easily can write your implementation.The MugenInjection offers several different parameter:
- ConstructorParameter - represents the value of a constructor argument.
- PropertyParameter - represents the value of a property.
- MethodParameter - represents the value of a method argument.
- InjectionParameter - represents the base class for parameters.
The InjectionParameter matching strategies depends only from you, you pass a delegate which is responsible for the parameter-selection.