-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDotNetNativeServiceInjector.cs
More file actions
44 lines (41 loc) · 2.01 KB
/
DotNetNativeServiceInjector.cs
File metadata and controls
44 lines (41 loc) · 2.01 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
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using System.Diagnostics;
namespace RapidField.SolidInstruments.InversionOfControl.DotNetNative
{
/// <summary>
/// Facilitates injection of a collection of service descriptors into a <see cref="ServiceCollection" />.
/// </summary>
public sealed class DotNetNativeServiceInjector : ServiceInjector<ServiceCollection>
{
/// <summary>
/// Initializes a new instance of the <see cref="DotNetNativeServiceInjector" /> class.
/// </summary>
/// <param name="serviceDescriptors">
/// A collection of service descriptors that are injected to a configurator.
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="serviceDescriptors" /> is <see langword="null" />.
/// </exception>
[DebuggerHidden]
internal DotNetNativeServiceInjector(IServiceCollection serviceDescriptors)
: base(serviceDescriptors)
{
return;
}
/// <summary>
/// Adds a collection of service descriptors to a <see cref="ServiceCollection" />.
/// </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(ServiceCollection configurator, IServiceCollection serviceDescriptors) => configurator.Add(serviceDescriptors);
}
}