/src/LinFu.IoC/Configuration/Interfaces/IUsingLambda.cs
http://github.com/philiplaureano/LinFu · C# · 71 lines · 12 code · 4 blank · 55 comment · 0 complexity · d0bcd10bab40b4373ae4059aa26b54b7 MD5 · raw file
- using System;
- using LinFu.IoC.Interfaces;
- namespace LinFu.IoC.Configuration
- {
- /// <summary>
- /// Represents a fluent class that creates
- /// a factory method that will be used
- /// in instantiating a specific service instance.
- /// </summary>
- /// <typeparam name="TService">The service type being instantiated.</typeparam>
- public interface IUsingLambda<TService>
- {
- /// <summary>
- /// Creates a service instance using the
- /// concrete <typeparamref name="TConcrete" /> type
- /// as the implementation for the <typeparamref name="TService" />
- /// type.
- /// </summary>
- /// <typeparam name="TConcrete">
- /// The concrete implementation that implements <typeparamref name="TService" />. This class
- /// must have a default constructor.
- /// </typeparam>
- /// <returns>
- /// A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
- /// specific container.
- /// </returns>
- IGenerateFactory<TService> Using<TConcrete>() where TConcrete : TService;
- /// <summary>
- /// Creates a service instance using the
- /// <paramref name="factoryMethod" /> to
- /// instantiate the service instance
- /// with a particular factory type.
- /// </summary>
- /// <seealso cref="IGenerateFactory{T}" />
- /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
- /// <returns>
- /// A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
- /// specific container.
- /// </returns>
- IGenerateFactory<TService> Using(Func<IServiceContainer, object[], TService> factoryMethod);
- /// <summary>
- /// Creates a service instance using the
- /// <paramref name="factoryMethod" /> to
- /// instantiate the service instance
- /// with a particular factory type.
- /// </summary>
- /// <seealso cref="IGenerateFactory{T}" />
- /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
- /// <returns>
- /// A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
- /// specific container.
- /// </returns>
- IGenerateFactory<TService> Using(Func<IServiceContainer, TService> factoryMethod);
- /// <summary>
- /// Creates a service instance using the
- /// <paramref name="factoryMethod" /> to
- /// instantiate the service instance
- /// with a particular factory type.
- /// </summary>
- /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
- /// <returns>
- /// A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
- /// specific container.
- /// </returns>
- IGenerateFactory<TService> Using(Func<TService> factoryMethod);
- }
- }