|
6 | 6 | namespace ApacheTech.Common.DependencyInjection.Abstractions
|
7 | 7 | {
|
8 | 8 | /// <summary>
|
9 |
| - /// An IOC Container, which holds references to registered types of services, and their instances. |
| 9 | + /// An IOC Container, which holds references to Added types of services, and their instances. |
10 | 10 | /// </summary>
|
11 |
| - public interface IServiceCollection |
| 11 | + public partial interface IServiceCollection |
12 | 12 | {
|
13 | 13 | /// <summary>
|
14 |
| - /// Registers a raw service descriptor, pre-populated with meta-data for the service. |
| 14 | + /// Adds a raw service descriptor, pre-populated with meta-data for the service. |
15 | 15 | /// </summary>
|
16 |
| - /// <param name="descriptor">The pre-populated descriptor for the service to register.</param> |
| 16 | + /// <param name="descriptor">The pre-populated descriptor for the service to add.</param> |
17 | 17 | /// <seealso cref="ServiceDescriptor"/>
|
18 |
| - void Register(ServiceDescriptor descriptor); |
| 18 | + void Add(ServiceDescriptor descriptor); |
19 | 19 |
|
20 | 20 | /// <summary>
|
21 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 21 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
22 | 22 | /// </summary>
|
23 | 23 | /// <param name="implementationType">The type of implementation to use.</param>
|
24 | 24 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
25 |
| - void RegisterSingleton(Type implementationType); |
| 25 | + void AddSingleton(Type implementationType); |
26 | 26 |
|
27 | 27 | /// <summary>
|
28 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 28 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
29 | 29 | /// </summary>
|
30 |
| - /// <param name="serviceType">The type of service to register.</param> |
| 30 | + /// <param name="serviceType">The type of service to add.</param> |
31 | 31 | /// <param name="implementationType">The type of implementation to use.</param>
|
32 | 32 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
33 |
| - void RegisterSingleton(Type serviceType, Type implementationType); |
| 33 | + void AddSingleton(Type serviceType, Type implementationType); |
34 | 34 |
|
35 | 35 | /// <summary>
|
36 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 36 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
37 | 37 | /// </summary>
|
38 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 38 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
39 | 39 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
40 | 40 | ///
|
41 |
| - void RegisterSingleton<TService>() where TService : class; |
| 41 | + void AddSingleton<TService>() where TService : class; |
42 | 42 |
|
43 | 43 | /// <summary>
|
44 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 44 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
45 | 45 | /// </summary>
|
46 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 46 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
47 | 47 | /// <typeparam name="TImplementation">The type of implementation to use.</typeparam>
|
48 | 48 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
49 |
| - void RegisterSingleton<TService, TImplementation>() where TImplementation : TService; |
| 49 | + void AddSingleton<TService, TImplementation>() where TImplementation : TService; |
50 | 50 |
|
51 | 51 | /// <summary>
|
52 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 52 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
53 | 53 | /// </summary>
|
54 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 54 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
55 | 55 | /// <param name="implementationFactory">The factory that creates the service.</param>
|
56 | 56 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
57 |
| - void RegisterSingleton<TService>(Func<IServiceResolver, TService> implementationFactory) where TService : class; |
| 57 | + void AddSingleton<TService>(Func<IServiceResolver, TService> implementationFactory) where TService : class; |
58 | 58 |
|
59 | 59 | /// <summary>
|
60 |
| - /// Registers a service as a singleton. Only one instance of the service will be created within the container. |
| 60 | + /// Adds a service as a singleton. Only one instance of the service will be created within the container. |
61 | 61 | /// </summary>
|
62 |
| - /// <typeparam name="TService">The instance to register.</typeparam> |
| 62 | + /// <typeparam name="TService">The instance to add.</typeparam> |
63 | 63 | /// <seealso cref="ServiceLifetime.Singleton"/>
|
64 |
| - void RegisterSingleton<TService>(TService implementation); |
| 64 | + void AddSingleton<TService>(TService implementation); |
65 | 65 |
|
66 | 66 | /// <summary>
|
67 |
| - /// Registers a service as a singleton. A new instance of the service will be created each time it is resolved. |
| 67 | + /// Adds a service as a singleton. A new instance of the service will be created each time it is resolved. |
68 | 68 | /// </summary>
|
69 | 69 | /// <param name="implementationType">The type of implementation to use.</param>
|
70 | 70 | /// <seealso cref="ServiceLifetime.Transient"/>
|
71 |
| - void RegisterTransient(Type implementationType); |
| 71 | + void AddTransient(Type implementationType); |
72 | 72 |
|
73 | 73 | /// <summary>
|
74 |
| - /// Registers a service as a singleton. A new instance of the service will be created each time it is resolved. |
| 74 | + /// Adds a service as a singleton. A new instance of the service will be created each time it is resolved. |
75 | 75 | /// </summary>
|
76 |
| - /// <param name="serviceType">The type of service to register.</param> |
| 76 | + /// <param name="serviceType">The type of service to add.</param> |
77 | 77 | /// <param name="implementationType">The type of implementation to use.</param>
|
78 | 78 | /// <seealso cref="ServiceLifetime.Transient"/>
|
79 |
| - void RegisterTransient(Type serviceType, Type implementationType); |
| 79 | + void AddTransient(Type serviceType, Type implementationType); |
80 | 80 |
|
81 | 81 | /// <summary>
|
82 |
| - /// Registers a service as a singleton. A new instance of the service will be created each time it is resolved. |
| 82 | + /// Adds a service as a singleton. A new instance of the service will be created each time it is resolved. |
83 | 83 | /// </summary>
|
84 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 84 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
85 | 85 | /// <seealso cref="ServiceLifetime.Transient"/>
|
86 |
| - void RegisterTransient<TService>() where TService : class; |
| 86 | + void AddTransient<TService>() where TService : class; |
87 | 87 |
|
88 | 88 | /// <summary>
|
89 |
| - /// Registers a service as a singleton. A new instance of the service will be created each time it is resolved. |
| 89 | + /// Adds a service as a singleton. A new instance of the service will be created each time it is resolved. |
90 | 90 | /// </summary>
|
91 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 91 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
92 | 92 | /// <typeparam name="TImplementation">The type of implementation to use.</typeparam>
|
93 | 93 | /// <seealso cref="ServiceLifetime.Transient"/>
|
94 |
| - void RegisterTransient<TService, TImplementation>() where TImplementation : TService; |
| 94 | + void AddTransient<TService, TImplementation>() where TImplementation : TService; |
95 | 95 |
|
96 | 96 | /// <summary>
|
97 |
| - /// Registers a service as a singleton. A new instance of the service will be created each time it is resolved. |
| 97 | + /// Adds a service as a singleton. A new instance of the service will be created each time it is resolved. |
98 | 98 | /// </summary>
|
99 |
| - /// <typeparam name="TService">The type of service to register.</typeparam> |
| 99 | + /// <typeparam name="TService">The type of service to add.</typeparam> |
100 | 100 | /// <param name="implementationFactory">The factory that creates the service.</param>
|
101 | 101 | /// <seealso cref="ServiceLifetime.Transient"/>
|
102 |
| - void RegisterTransient<TService>(Func<IServiceResolver, TService> implementationFactory) where TService : class; |
| 102 | + void AddTransient<TService>(Func<IServiceResolver, TService> implementationFactory) where TService : class; |
103 | 103 |
|
104 | 104 | /// <summary>
|
105 | 105 | /// Build a service resolver, to access services within this collection.
|
|
0 commit comments