You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
857 B
27 lines
857 B
using CoreAgent.Domain.Interfaces;
|
|
using CoreAgent.Infrastructure.Command;
|
|
using CoreAgent.Infrastructure.Services;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace CoreAgent.Infrastructure.Extensions;
|
|
|
|
/// <summary>
|
|
/// 服务集合扩展方法
|
|
/// </summary>
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// 添加命令策略服务
|
|
/// </summary>
|
|
/// <param name="services">服务集合</param>
|
|
/// <returns>服务集合</returns>
|
|
public static IServiceCollection AddCommandCustomService(this IServiceCollection services)
|
|
{
|
|
// 注册命令策略工厂
|
|
services.AddSingleton<ICommandStrategyFactory, CommandStrategyFactory>();
|
|
|
|
// 注册 ICellularNetworkService
|
|
services.AddScoped<ICellularNetworkService, CellularNetworkService>();
|
|
return services;
|
|
}
|
|
}
|