-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathServiceCollectionExtensions.cs
More file actions
37 lines (33 loc) · 1.16 KB
/
ServiceCollectionExtensions.cs
File metadata and controls
37 lines (33 loc) · 1.16 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
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.OpcDa;
using System.Runtime.Versioning;
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
/// OpcDaServer 服务扩展类
/// </summary>
public static class ServiceCollectionExtensions
{
/// <summary>
/// 增加 OpcDaServer 操作服务
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
[SupportedOSPlatform("windows")]
public static IServiceCollection AddOpcDaServer(this IServiceCollection services)
{
services.AddSingleton<IOpcDaServer, OpcDaServer>();
return services;
}
/// <summary>
/// 增加模拟 OpcDaServer 操作服务
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection AddMockOpcDaServer(this IServiceCollection services)
{
services.AddSingleton<IOpcDaServer, MockOpcDaServer>();
return services;
}
}