39 lines
1.2 KiB
C#
Raw Normal View History

2025-04-07 16:44:25 +08:00
using JiShe.CollectBus.IoTDBProvider.Context;
using JiShe.CollectBus.IoTDBProvider.Interface;
using JiShe.CollectBus.IoTDBProvider.Provider;
2025-04-17 13:35:08 +08:00
using Microsoft.Extensions.Configuration;
2025-04-07 16:44:25 +08:00
using Microsoft.Extensions.DependencyInjection;
2025-04-02 14:06:40 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Modularity;
2025-04-17 13:35:08 +08:00
using static Thrift.Server.TThreadPoolAsyncServer;
2025-04-02 14:06:40 +08:00
namespace JiShe.CollectBus.IoTDBProvider
{
public class CollectBusIoTDBModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
2025-04-17 13:35:08 +08:00
var configuration = context.Services.GetConfiguration();
Configure<IoTDBOptions>(options =>
{
configuration.GetSection(nameof(IoTDBOptions)).Bind(options);
});
2025-04-07 16:44:25 +08:00
// 注册上下文为Scoped
context.Services.AddScoped<IoTDBRuntimeContext>();
// 注册Session工厂
context.Services.AddSingleton<IIoTDBSessionFactory, IoTDBSessionFactory>();
// 注册Provider
context.Services.AddScoped<IIoTDBProvider, IoTDBProvider>();
2025-04-02 14:06:40 +08:00
}
}
}