22 lines
797 B
C#
22 lines
797 B
C#
using JiShe.CollectBus.Protocol.Contracts.Interfaces;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp;
|
|
using Volo.Abp.Modularity;
|
|
|
|
namespace JiShe.CollectBus.Protocol
|
|
{
|
|
public class JiSheCollectBusProtocolModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
context.Services.AddKeyedSingleton<IProtocolPlugin, StandardProtocolPlugin>(nameof(StandardProtocolPlugin));
|
|
}
|
|
|
|
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
|
{
|
|
var standardProtocol = context.ServiceProvider.GetRequiredKeyedService<IProtocolPlugin>(nameof(StandardProtocolPlugin));
|
|
await standardProtocol.LoadAsync();
|
|
}
|
|
}
|
|
}
|