PageRenderTime 54ms CodeModel.GetById 49ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1using System;
 2using LinFu.IoC.Interfaces;
 3
 4namespace LinFu.IoC.Configuration
 5{
 6    /// <summary>
 7    ///     Represents a fluent class that creates
 8    ///     a factory method that will be used
 9    ///     in instantiating a specific service instance.
10    /// </summary>
11    /// <typeparam name="TService">The service type being instantiated.</typeparam>
12    public interface IUsingLambda<TService>
13    {
14        /// <summary>
15        ///     Creates a service instance using the
16        ///     concrete <typeparamref name="TConcrete" /> type
17        ///     as the implementation for the <typeparamref name="TService" />
18        ///     type.
19        /// </summary>
20        /// <typeparam name="TConcrete">
21        ///     The concrete implementation that implements <typeparamref name="TService" />. This class
22        ///     must have a default constructor.
23        /// </typeparam>
24        /// <returns>
25        ///     A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
26        ///     specific container.
27        /// </returns>
28        IGenerateFactory<TService> Using<TConcrete>() where TConcrete : TService;
29
30        /// <summary>
31        ///     Creates a service instance using the
32        ///     <paramref name="factoryMethod" /> to
33        ///     instantiate the service instance
34        ///     with a particular factory type.
35        /// </summary>
36        /// <seealso cref="IGenerateFactory{T}" />
37        /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
38        /// <returns>
39        ///     A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
40        ///     specific container.
41        /// </returns>
42        IGenerateFactory<TService> Using(Func<IServiceContainer, object[], TService> factoryMethod);
43
44        /// <summary>
45        ///     Creates a service instance using the
46        ///     <paramref name="factoryMethod" /> to
47        ///     instantiate the service instance
48        ///     with a particular factory type.
49        /// </summary>
50        /// <seealso cref="IGenerateFactory{T}" />
51        /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
52        /// <returns>
53        ///     A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
54        ///     specific container.
55        /// </returns>
56        IGenerateFactory<TService> Using(Func<IServiceContainer, TService> factoryMethod);
57
58        /// <summary>
59        ///     Creates a service instance using the
60        ///     <paramref name="factoryMethod" /> to
61        ///     instantiate the service instance
62        ///     with a particular factory type.
63        /// </summary>
64        /// <param name="factoryMethod">The factory method that will be used to instantiate the actual service instance.</param>
65        /// <returns>
66        ///     A non-null <see cref="IGenerateFactory{T}" /> instance that will be used to create a factory and add it to a
67        ///     specific container.
68        /// </returns>
69        IGenerateFactory<TService> Using(Func<TService> factoryMethod);
70    }
71}