22 lines
756 B
C#
22 lines
756 B
C#
|
|
using JiShe.CollectBus.Protocol.Contracts.Interfaces;
|
|||
|
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
using Volo.Abp;
|
|||
|
|
using Volo.Abp.Modularity;
|
|||
|
|
|
|||
|
|
namespace JiShe.CollectBus.Protocol.Test
|
|||
|
|
{
|
|||
|
|
public class JiSheCollectBusProtocolModule : AbpModule
|
|||
|
|
{
|
|||
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|||
|
|
{
|
|||
|
|
context.Services.AddKeyedSingleton<IProtocolPlugin, TestProtocolPlugin>(nameof(TestProtocolPlugin));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|||
|
|
{
|
|||
|
|
var protocol = context.ServiceProvider.GetRequiredKeyedService<IProtocolPlugin>(nameof(TestProtocolPlugin));
|
|||
|
|
protocol.AddAsync();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|