/// The <see cref="Type"/> that implements the <see cref="IRegistrationBase.InterfaceType"/> that is registered with this <see cref="IDefaultRegistration{TInterface}"/>
/// The <see cref="Type"/> that implements the <see cref="IRegistration.InterfaceType"/> that is registered with this <see cref="IRegistrationBase{TInterface}"/>
/// </summary>
TypeImplementationType{get;}
/// <summary>
/// The Lifestyle of Instances that are created with this <see cref="IDefaultRegistration{TInterface}"/>
/// </summary>
LifestyleLifestyle{get;}
/// <summary>
/// This <see cref="Action{T}"/> is invoked when an instance of this type is created.
/// <para>Can be set in the <see cref="IIocInstaller"/> by calling <see cref="OnCreate"/></para>
/// </summary>
Action<TInterface>OnCreateAction{get;}
/// <summary>
/// Pass an <see cref="Action{T}"/> that will be invoked when an instance of this type is created
/// An <see cref="Array"/> of parameters that are used to <see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Can be set in the <see cref="IIocInstaller"/> by calling <see cref="WithParameters(object[])"/></para>
/// </summary>
object[]Parameters{get;}
/// <summary>
/// Pass parameters that will be used to<see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving</para>
/// Pass parameters that will be used to<see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving</para>
/// </summary>
/// <param name="parameters">The parameters with their position</param>
/// <returns>The current instance of this <see cref="IRegistrationBase{TInterface}"/></returns>
/// <exception cref="InvalidRegistrationException"><see cref="Parameters"/> are already set or no parameters given</exception>
/// A special <see cref="IRegistrationBase"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
/// A special <see cref="IRegistration"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
thrownewInvalidRegistrationException($"Can't register an interface without its implementation type or without a factory method (Type: {singleTypeRegistration.InterfaceType}).");
if(singleTypeRegistration.FactoryMethod==null)//type registration without interface -> just create this type
/// Update the given arguments with the <see cref="IRegistrationBase{TInterface}.Parameters"/> of the given <see cref="IRegistrationBase{TInterface}"/>
/// </summary>
/// <typeparam name="T">The given <see cref="Type"/></typeparam>
/// <param name="registration">The <see cref="IRegistrationBase{TInterface}"/> of the given <see cref="Type"/></param>
if(!(currentParameterisInternalResolvePlaceholder))//use the parameter at the current index if it is not a placeholder
{
newArguments[i]=currentParameter;
continue;
}
}
objectfirstArgument=arguments.FirstOrGiven<object,InternalResolvePlaceholder>(a=>!(aisInternalResolvePlaceholder));//find the first argument that is not a placeholder
if(firstArgumentisInternalResolvePlaceholder)//no more arguments available
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>s and can resolve all the types you'll ever want
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s and can resolve all the types you'll ever want
<typeparamname="TInterface">The Interface to register</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Install the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
Install the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s in the given <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
</summary>
<paramname="container">The current <seecref="T:LightweightIocContainer.Interfaces.IIocContainer"/></param>
The default registration that is used to register a <seecref="T:System.Type"/> for the Interface it implements
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/> to register a <seecref="T:System.Type"/> for the Interface it implements
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/>
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/>
The <seecref="T:System.Type"/> of the Interface that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>
This <seecref="T:System.Action`1"/> is invoked when an instance of this type is created.
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1.OnCreate(System.Action{`0})"/></para>
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1.OnCreate(System.Action{`0})"/></para>
The registration that is used to register a multiton
An <seecref="T:System.Array"/> of parameters that are used to <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1.WithParameters(System.Object[])"/></para>
The <seecref="T:System.Type"/> of the multiton scope
Pass parameters that will be used to<seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving</para>
</summary>
<paramname="parameters">The parameters</param>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException"><seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1.Parameters"/> are already set or no parameters given</exception>
The base registration that is used to register an Interface
Pass parameters that will be used to<seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving</para>
</summary>
<paramname="parameters">The parameters with their position</param>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException"><seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1.Parameters"/> are already set or no parameters given</exception>
The name of the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register either only an interface or only a <seecref="T:System.Type"/>
</summary>
<typeparamname="T">The <seecref="T:System.Type"/> of the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></typeparam>
The <seecref="T:System.Type"/> of the Interface that is registered with this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>
<seecref="T:System.Func`2"/> that is invoked instead of creating an instance of this <seecref="T:System.Type"/> the default way
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
</summary>
<typeparamname="TInterface"></typeparam>
</member>
@ -472,14 +520,19 @@
An <seecref="T:LightweightIocContainer.ResolveCallback`1"/> that is set as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>s and can resolve all the types you'll ever want
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s and can resolve all the types you'll ever want
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>s and can resolve all the types you'll ever want
The main container that carries all the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s and can resolve all the types you'll ever want
<typeparamname="TInterface">The Interface to register</typeparam>
<typeparamname="TImplementation">The Type that implements the interface</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Register a <seecref="T:System.Type"/> without an interface
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></returns>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></param>
<returns>The created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></returns>
Add the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> to the the <seecref="T:LightweightIocContainer.IocContainer"/>
Add the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> to the the <seecref="T:LightweightIocContainer.IocContainer"/>
</summary>
<paramname="registration">The given <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/></param>
<paramname="registration">The given <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/></param>
<exceptioncref="T:LightweightIocContainer.Exceptions.MultipleRegistrationException">The <seecref="T:System.Type"/> is already registered in this <seecref="T:LightweightIocContainer.IocContainer"/></exception>
<exceptioncref="T:LightweightIocContainer.Exceptions.TypeNotRegisteredException">The given <seecref="T:System.Type"/> is not registered in this <seecref="T:LightweightIocContainer.IocContainer"/></exception>
<exceptioncref="T:LightweightIocContainer.Exceptions.UnknownRegistrationException">The registration for the given <seecref="T:System.Type"/> has an unknown <seecref="T:System.Type"/></exception>
Update the given arguments with the <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1.Parameters"/> of the given <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/>
</summary>
<typeparamname="T">The given <seecref="T:System.Type"/></typeparam>
<paramname="registration">The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> of the given <seecref="T:System.Type"/></param>
The default registration that is used to register a <seecref="T:System.Type"/> for the Interface it implements
The <seecref="T:LightweightIocContainer.Registrations.DefaultRegistration`1"/> to register a <seecref="T:System.Type"/> for the Interface it implements
The default registration that is used to register a <seecref="T:System.Type"/> for the Interface it implements
The <seecref="T:LightweightIocContainer.Registrations.DefaultRegistration`1"/> to register a <seecref="T:System.Type"/> for the Interface it implements
</summary>
<paramname="interfaceType">The <seecref="T:System.Type"/> of the interface</param>
<paramname="implementationType">The <seecref="T:System.Type"/> of the implementation</param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> of the <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/></param>
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Registrations.RegistrationBase`1.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/>
The <seecref="T:System.Type"/> of the Interface that is registered with this <seecref="T:LightweightIocContainer.Registrations.DefaultRegistration`1"/>
The <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/> that is used to register an Interface
The <seecref="T:System.Type"/> that implements the <seecref="P:LightweightIocContainer.Registrations.DefaultRegistration`1.InterfaceType"/> that is registered with this <seecref="T:LightweightIocContainer.Registrations.DefaultRegistration`1"/>
The <seecref="T:System.Type"/>of the Interface that is registered with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/>
The <seecref="T:LightweightIocContainer.Lifestyle"/> of Instances that are created with this <seecref="T:LightweightIocContainer.Registrations.DefaultRegistration`1"/>
The <seecref="T:LightweightIocContainer.Lifestyle"/> of Instances that are created with this <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/>
This <seecref="T:System.Action`1"/> is invoked when an instance of this type is created.
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Registrations.DefaultRegistration`1.OnCreate(System.Action{`0})"/></para>
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Registrations.RegistrationBase`1.OnCreate(System.Action{`0})"/></para>
The registration that is used to register a multiton
An <seecref="T:System.Array"/> of parameters that are used to <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Can be set in the <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> by calling <seecref="M:LightweightIocContainer.Registrations.RegistrationBase`1.WithParameters(System.Object[])"/></para>
The registration that is used to register a multiton
Pass parameters that will be used to<seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving</para>
</summary>
<paramname="interfaceType">The <seecref="T:System.Type"/> of the Interface</param>
<paramname="implementationType">The <seecref="T:System.Type"/> of the Implementation</param>
<paramname="scope">The <seecref="T:System.Type"/> of the Multiton Scope</param>
<paramname="parameters">The parameters</param>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException"><seecref="P:LightweightIocContainer.Registrations.RegistrationBase`1.Parameters"/> are already set or no parameters given</exception>
The <seecref="T:System.Type"/> of the multiton scope
Pass parameters that will be used to<seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/> an instance of this <seecref="P:LightweightIocContainer.Interfaces.Registrations.IRegistration.InterfaceType"/>
<para>Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving</para>
</summary>
<paramname="parameters">The parameters with their position</param>
<returns>The current instance of this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></returns>
<exceptioncref="T:LightweightIocContainer.Exceptions.InvalidRegistrationException"><seecref="P:LightweightIocContainer.Registrations.RegistrationBase`1.Parameters"/> are already set or no parameters given</exception>
A factory to register interfaces and factories in an <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> and create the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/>s
A factory to register interfaces and factories in an <seecref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> and create the needed <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s
Register a <seecref="T:System.Type"/> without an interface and create a <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/>
Register a <seecref="T:System.Type"/> without an interface and create a <seecref="T:LightweightIocContainer.Interfaces.Registrations.ISingleTypeRegistration`1"/>
</summary>
<typeparamname="TImplementation">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/></param>
<returns>A new created <seecref="T:LightweightIocContainer.Interfaces.Registrations.IDefaultRegistration`1"/> with the given parameters</returns>
<typeparamname="T">The <seecref="T:System.Type"/> to register</typeparam>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> for this <seecref="T:LightweightIocContainer.Interfaces.Registrations.ISingleTypeRegistration`1"/></param>
<returns>A new created <seecref="T:LightweightIocContainer.Interfaces.Registrations.ISingleTypeRegistration`1"/> with the given parameters</returns>
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register either only an interface or only a <seecref="T:System.Type"/>
</summary>
<typeparamname="T">The <seecref="T:System.Type"/> of the <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/></typeparam>
The <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase`1"/> to register either only an interface or only a <seecref="T:System.Type"/>
</summary>
<paramname="interfaceType">The <seecref="T:System.Type"/> of the interface or <seecref="T:System.Type"/></param>
<paramname="lifestyle">The <seecref="T:LightweightIocContainer.Lifestyle"/> of the <seecref="T:LightweightIocContainer.Registrations.RegistrationBase`1"/></param>
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationBase"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
A special <seecref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/> that allows to set a <seecref="T:LightweightIocContainer.ResolveCallback`1"/> as a callback that is called on <seecref="M:LightweightIocContainer.Interfaces.IIocContainer.Resolve``1"/>
</summary>
<paramname="interfaceType">The <seecref="T:System.Type"/> of the interface</param>
<paramname="unitTestResolveCallback">The <seecref="T:LightweightIocContainer.ResolveCallback`1"/> that is set as a callback</param>
/// The name of the <see cref="DefaultRegistration{TInterface}"/>
/// </summary>
publicstringName{get;}
/// <summary>
/// The <see cref="Type"/> of the Interface that is registered with this <see cref="DefaultRegistration{TInterface}"/>
/// </summary>
publicTypeInterfaceType{get;}
/// <summary>
/// The <see cref="Type"/> that implements the <see cref="InterfaceType"/> that is registered with this <see cref="DefaultRegistration{TInterface}"/>
/// The <see cref="Type"/> that implements the <see cref="RegistrationBase{TInterface}.InterfaceType"/> that is registered with this <see cref="RegistrationBase{TInterface}"/>
/// </summary>
publicTypeImplementationType{get;}
/// <summary>
/// The <see cref="LightweightIocContainer.Lifestyle"/> of Instances that are created with this <see cref="DefaultRegistration{TInterface}"/>
/// </summary>
publicLifestyleLifestyle{get;}
/// <summary>
/// This <see cref="Action{T}"/> is invoked when an instance of this type is created.
/// <para>Can be set in the <see cref="IIocInstaller"/> by calling <see cref="OnCreate"/></para>
/// An <see cref="Array"/> of parameters that are used to <see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Can be set in the <see cref="IIocInstaller"/> by calling <see cref="WithParameters(object[])"/></para>
/// </summary>
publicobject[]Parameters{get;privateset;}
/// <summary>
/// Pass parameters that will be used to<see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Parameters set with this method are always inserted at the beginning of the argument list if more parameters are given when resolving</para>
thrownewInvalidRegistrationException($"Don't use `WithParameters()` method twice (Type: {InterfaceType}).");
if(parameters==null||!parameters.Any())
thrownewInvalidRegistrationException($"No parameters given to `WithParameters()` method (Type: {InterfaceType}).");
Parameters=parameters;
returnthis;
}
/// <summary>
/// Pass parameters that will be used to<see cref="IIocContainer.Resolve{T}()"/> an instance of this <see cref="IRegistration.InterfaceType"/>
/// <para>Parameters set with this method are inserted at the position in the argument list that is passed with the parameter if more parameters are given when resolving</para>
/// </summary>
/// <param name="parameters">The parameters with their position</param>
/// <returns>The current instance of this <see cref="IRegistrationBase{TInterface}"/></returns>
/// <exception cref="InvalidRegistrationException"><see cref="Parameters"/> are already set or no parameters given</exception>
@ -9,13 +9,14 @@ using LightweightIocContainer.Interfaces.Registrations;
namespaceLightweightIocContainer.Registrations
{
/// <summary>
/// A special <see cref="IRegistrationBase"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
/// A special <see cref="IRegistration"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
/// </summary>
/// <typeparam name="TInterface"></typeparam>
[Obsolete("UnitTestCallbackRegistration is deprecated, use `WithFactoryMethod()` from ISingleTypeRegistration instead.")]
/// A special <see cref="IRegistrationBase"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
/// A special <see cref="IRegistration"/> that allows to set a <see cref="ResolveCallback{T}"/> as a callback that is called on <see cref="IIocContainer.Resolve{T}()"/>
/// </summary>
/// <param name="interfaceType">The <see cref="Type"/> of the interface</param>
/// <param name="unitTestResolveCallback">The <see cref="ResolveCallback{T}"/> that is set as a callback</param>