-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNullOperationServiceInjector.cs
More file actions
49 lines (45 loc) · 2.06 KB
/
NullOperationServiceInjector.cs
File metadata and controls
49 lines (45 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics;
namespace RapidField.SolidInstruments.InversionOfControl
{
/// <summary>
/// Represents a <see cref="ServiceInjector{TConfigurator}" /> that performs a null operation.
/// </summary>
/// <typeparam name="TConfigurator">
/// The type of the object that configures a container.
/// </typeparam>
internal sealed class NullOperationServiceInjector<TConfigurator> : ServiceInjector<TConfigurator>
where TConfigurator : class, new()
{
/// <summary>
/// Initializes a new instance of the <see cref="NullOperationServiceInjector{TConfigurator}" /> class.
/// </summary>
public NullOperationServiceInjector()
: base(EmptyServiceCollection)
{
return;
}
/// <summary>
/// Adds a collection of service descriptors to a <see cref="DependencyContainer{TContainer, TConfigurator}" />
/// configurator.
/// </summary>
/// <param name="configurator">
/// The object that configures a container.
/// </param>
/// <param name="serviceDescriptors">
/// a collection of service descriptors that are added to the configurator.
/// </param>
protected sealed override void Inject(TConfigurator configurator, IServiceCollection serviceDescriptors)
{
return;
}
/// <summary>
/// Represents an empty service descriptor collection.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private static readonly IServiceCollection EmptyServiceCollection = new ServiceCollection();
}
}