- rename iResolve to IIocResolver

pull/57/head v3.0.1
Simon G 4 years ago
parent b3e9e8127c
commit 7755f3df3d
  1. 2
      LightweightIocContainer/Factories/TypedFactory.cs
  2. 2
      LightweightIocContainer/Interfaces/IIocResolver.cs
  3. 4
      LightweightIocContainer/Interfaces/Registrations/ISingleTypeRegistration.cs
  4. 2
      LightweightIocContainer/IocContainer.cs
  5. 44
      LightweightIocContainer/LightweightIocContainer.xml
  6. 4
      LightweightIocContainer/Registrations/SingleTypeRegistration.cs
  7. 2
      LightweightIocContainer/ResolvePlaceholders/InternalFactoryMethodPlaceholder.cs

@ -96,7 +96,7 @@ namespace LightweightIocContainer.Factories
generator.EmitCall(OpCodes.Call, emptyArray, null); generator.EmitCall(OpCodes.Call, emptyArray, null);
} }
generator.EmitCall(OpCodes.Callvirt, typeof(IResolver).GetMethod(nameof(IResolver.Resolve), new[] { typeof(object[]) })!.MakeGenericMethod(createMethod.ReturnType), null); generator.EmitCall(OpCodes.Callvirt, typeof(IIocResolver).GetMethod(nameof(IIocResolver.Resolve), new[] { typeof(object[]) })!.MakeGenericMethod(createMethod.ReturnType), null);
generator.Emit(OpCodes.Castclass, createMethod.ReturnType); generator.Emit(OpCodes.Castclass, createMethod.ReturnType);
generator.Emit(OpCodes.Ret); generator.Emit(OpCodes.Ret);
} }

@ -9,7 +9,7 @@ namespace LightweightIocContainer.Interfaces
/// <summary> /// <summary>
/// Provides <see cref="Resolve{T}()"/> methods /// Provides <see cref="Resolve{T}()"/> methods
/// </summary> /// </summary>
public interface IResolver : IDisposable public interface IIocResolver : IDisposable
{ {
/// <summary> /// <summary>
/// Gets an instance of the given <see cref="Type"/> /// Gets an instance of the given <see cref="Type"/>

@ -15,13 +15,13 @@ namespace LightweightIocContainer.Interfaces.Registrations
/// <summary> /// <summary>
/// <see cref="Func{T,TResult}"/> that is invoked instead of creating an instance of this <see cref="Type"/> the default way /// <see cref="Func{T,TResult}"/> that is invoked instead of creating an instance of this <see cref="Type"/> the default way
/// </summary> /// </summary>
Func<IResolver, T>? FactoryMethod { get; } Func<IIocResolver, T>? FactoryMethod { get; }
/// <summary> /// <summary>
/// Pass a <see cref="Func{T,TResult}"/> that will be invoked instead of creating an instance of this <see cref="Type"/> the default way /// Pass a <see cref="Func{T,TResult}"/> that will be invoked instead of creating an instance of this <see cref="Type"/> the default way
/// </summary> /// </summary>
/// <param name="factoryMethod">The <see cref="Func{T,TResult}"/></param> /// <param name="factoryMethod">The <see cref="Func{T,TResult}"/></param>
/// <returns>The current instance of this <see cref="IRegistration"/></returns> /// <returns>The current instance of this <see cref="IRegistration"/></returns>
ISingleTypeRegistration<T> WithFactoryMethod(Func<IResolver, T> factoryMethod); ISingleTypeRegistration<T> WithFactoryMethod(Func<IIocResolver, T> factoryMethod);
} }
} }

@ -21,7 +21,7 @@ namespace LightweightIocContainer
/// <summary> /// <summary>
/// The main container that carries all the <see cref="IRegistration"/>s and can resolve all the types you'll ever want /// The main container that carries all the <see cref="IRegistration"/>s and can resolve all the types you'll ever want
/// </summary> /// </summary>
public class IocContainer : IIocContainer, IResolver public class IocContainer : IIocContainer, IIocResolver
{ {
private readonly RegistrationFactory _registrationFactory; private readonly RegistrationFactory _registrationFactory;

@ -491,46 +491,46 @@
<typeparam name="T">The given <see cref="T:System.Type"/></typeparam> <typeparam name="T">The given <see cref="T:System.Type"/></typeparam>
<returns>True if the given <see cref="T:System.Type"/> is registered with this <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/>, false if not</returns> <returns>True if the given <see cref="T:System.Type"/> is registered with this <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/>, false if not</returns>
</member> </member>
<member name="T:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller"> <member name="T:LightweightIocContainer.Interfaces.IIocResolver">
<summary> <summary>
An <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> that installs all <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s for its given <see cref="T:System.Reflection.Assembly"/> Provides <see cref="M:LightweightIocContainer.Interfaces.IIocResolver.Resolve``1"/> methods
</summary> </summary>
</member> </member>
<member name="P:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller.Installers"> <member name="M:LightweightIocContainer.Interfaces.IIocResolver.Resolve``1">
<summary> <summary>
The <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s of the <see cref="T:System.Reflection.Assembly"/> that this <see cref="T:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller"/> is installing Gets an instance of the given <see cref="T:System.Type"/>
</summary> </summary>
<typeparam name="T">The given <see cref="T:System.Type"/></typeparam>
<returns>An instance of the given <see cref="T:System.Type"/></returns>
</member> </member>
<member name="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"> <member name="M:LightweightIocContainer.Interfaces.IIocResolver.Resolve``1(System.Object[])">
<summary> <summary>
The base class for <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/> installers Gets an instance of the given <see cref="T:System.Type"/>
</summary> </summary>
<typeparam name="T">The given <see cref="T:System.Type"/></typeparam>
<param name="arguments">The constructor arguments</param>
<returns>An instance of the given <see cref="T:System.Type"/></returns>
</member> </member>
<member name="M:LightweightIocContainer.Interfaces.Installers.IIocInstaller.Install(LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector)"> <member name="T:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller">
<summary> <summary>
Install the needed <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s in the given <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/> An <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/> that installs all <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s for its given <see cref="T:System.Reflection.Assembly"/>
</summary> </summary>
<param name="registration">The <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector"/> where <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s are added</param>
</member> </member>
<member name="T:LightweightIocContainer.Interfaces.IResolver"> <member name="P:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller.Installers">
<summary> <summary>
Provides <see cref="M:LightweightIocContainer.Interfaces.IResolver.Resolve``1"/> methods The <see cref="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller"/>s of the <see cref="T:System.Reflection.Assembly"/> that this <see cref="T:LightweightIocContainer.Interfaces.Installers.IAssemblyInstaller"/> is installing
</summary> </summary>
</member> </member>
<member name="M:LightweightIocContainer.Interfaces.IResolver.Resolve``1"> <member name="T:LightweightIocContainer.Interfaces.Installers.IIocInstaller">
<summary> <summary>
Gets an instance of the given <see cref="T:System.Type"/> The base class for <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/> installers
</summary> </summary>
<typeparam name="T">The given <see cref="T:System.Type"/></typeparam>
<returns>An instance of the given <see cref="T:System.Type"/></returns>
</member> </member>
<member name="M:LightweightIocContainer.Interfaces.IResolver.Resolve``1(System.Object[])"> <member name="M:LightweightIocContainer.Interfaces.Installers.IIocInstaller.Install(LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector)">
<summary> <summary>
Gets an instance of the given <see cref="T:System.Type"/> Install the needed <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s in the given <see cref="T:LightweightIocContainer.Interfaces.IIocContainer"/>
</summary> </summary>
<typeparam name="T">The given <see cref="T:System.Type"/></typeparam> <param name="registration">The <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistrationCollector"/> where <see cref="T:LightweightIocContainer.Interfaces.Registrations.IRegistration"/>s are added</param>
<param name="arguments">The constructor arguments</param>
<returns>An instance of the given <see cref="T:System.Type"/></returns>
</member> </member>
<member name="T:LightweightIocContainer.Interfaces.Registrations.Fluent.IOnCreate"> <member name="T:LightweightIocContainer.Interfaces.Registrations.Fluent.IOnCreate">
<summary> <summary>
@ -850,7 +850,7 @@
<see cref="T:System.Func`2"/> that is invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way <see cref="T:System.Func`2"/> that is invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way
</summary> </summary>
</member> </member>
<member name="M:LightweightIocContainer.Interfaces.Registrations.ISingleTypeRegistration`1.WithFactoryMethod(System.Func{LightweightIocContainer.Interfaces.IResolver,`0})"> <member name="M:LightweightIocContainer.Interfaces.Registrations.ISingleTypeRegistration`1.WithFactoryMethod(System.Func{LightweightIocContainer.Interfaces.IIocResolver,`0})">
<summary> <summary>
Pass a <see cref="T:System.Func`2"/> that will be invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way Pass a <see cref="T:System.Func`2"/> that will be invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way
</summary> </summary>
@ -1717,7 +1717,7 @@
<see cref="T:System.Func`2"/> that is invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way <see cref="T:System.Func`2"/> that is invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way
</summary> </summary>
</member> </member>
<member name="M:LightweightIocContainer.Registrations.SingleTypeRegistration`1.WithFactoryMethod(System.Func{LightweightIocContainer.Interfaces.IResolver,`0})"> <member name="M:LightweightIocContainer.Registrations.SingleTypeRegistration`1.WithFactoryMethod(System.Func{LightweightIocContainer.Interfaces.IIocResolver,`0})">
<summary> <summary>
Pass a <see cref="T:System.Func`2"/> that will be invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way Pass a <see cref="T:System.Func`2"/> that will be invoked instead of creating an instance of this <see cref="T:System.Type"/> the default way
</summary> </summary>

@ -29,14 +29,14 @@ namespace LightweightIocContainer.Registrations
/// <summary> /// <summary>
/// <see cref="Func{T,TResult}"/> that is invoked instead of creating an instance of this <see cref="Type"/> the default way /// <see cref="Func{T,TResult}"/> that is invoked instead of creating an instance of this <see cref="Type"/> the default way
/// </summary> /// </summary>
public Func<IResolver, T>? FactoryMethod { get; private set; } public Func<IIocResolver, T>? FactoryMethod { get; private set; }
/// <summary> /// <summary>
/// Pass a <see cref="Func{T,TResult}"/> that will be invoked instead of creating an instance of this <see cref="Type"/> the default way /// Pass a <see cref="Func{T,TResult}"/> that will be invoked instead of creating an instance of this <see cref="Type"/> the default way
/// </summary> /// </summary>
/// <param name="factoryMethod">The <see cref="Func{T,TResult}"/></param> /// <param name="factoryMethod">The <see cref="Func{T,TResult}"/></param>
/// <returns>The current instance of this <see cref="IRegistration"/></returns> /// <returns>The current instance of this <see cref="IRegistration"/></returns>
public ISingleTypeRegistration<T> WithFactoryMethod(Func<IResolver, T> factoryMethod) public ISingleTypeRegistration<T> WithFactoryMethod(Func<IIocResolver, T> factoryMethod)
{ {
FactoryMethod = factoryMethod; FactoryMethod = factoryMethod;
return this; return this;

@ -27,5 +27,5 @@ internal class InternalFactoryMethodPlaceholder<T> : IInternalToBeResolvedPlaceh
/// <summary> /// <summary>
/// The <see cref="ISingleTypeRegistration{T}.FactoryMethod"/> /// The <see cref="ISingleTypeRegistration{T}.FactoryMethod"/>
/// </summary> /// </summary>
public Func<IResolver, T> FactoryMethod { get; } public Func<IIocResolver, T> FactoryMethod { get; }
} }
Loading…
Cancel
Save