mirror of
https://gitee.com/iioter/iotgateway.git
synced 2024-11-29 18:28:09 +08:00
解决了uaserver初始化失败的问题
This commit is contained in:
parent
724c46a9f1
commit
cb00bed893
Binary file not shown.
@ -73,14 +73,14 @@ namespace IoTGateway
|
||||
|
||||
|
||||
services.AddHostedService<IoTBackgroundService>();
|
||||
services.AddSingleton<UAService>();
|
||||
services.AddSingleton<DeviceService>();
|
||||
services.AddSingleton<DrvierService>();
|
||||
services.AddSingleton<UAService>();
|
||||
services.AddSingleton<MyMqttClient>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IOptionsMonitor<Configs> configs, UAService uAService, DeviceService deviceService)
|
||||
public void Configure(IApplicationBuilder app, IOptionsMonitor<Configs> configs, DeviceService deviceService)
|
||||
{
|
||||
IconFontsHelper.GenerateIconFont();
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace Plugin
|
||||
private DBTypeEnum DBType = IoTBackgroundService.DBType;
|
||||
private Interpreter interpreter = new();
|
||||
|
||||
public DeviceService(IConfiguration ConfigRoot, DrvierService drvierManager, MyMqttClient myMqttClient, IMqttServer mqttServer)
|
||||
public DeviceService(IConfiguration ConfigRoot, DrvierService drvierManager, MyMqttClient myMqttClient, UAService uAService, IMqttServer mqttServer )
|
||||
{
|
||||
_DrvierManager = drvierManager;
|
||||
_MyMqttClient = myMqttClient;
|
||||
|
@ -2777,11 +2777,11 @@ namespace Quickstarts.ReferenceServer
|
||||
#region IoTGatewayDevice
|
||||
using (var DC = new DataContext(IoTBackgroundService.connnectSetting, IoTBackgroundService.DBType))
|
||||
{
|
||||
foreach (var group in DC.Set<Device>().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).OrderBy(x => x.Index))
|
||||
foreach (var group in DC.Set<Device>().AsNoTracking().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).OrderBy(x => x.Index).ToList())
|
||||
{
|
||||
FolderState deviceGroupFolder = CreateFolder(root, group.DeviceName, group.DeviceName);
|
||||
|
||||
foreach (var device in DC.Set<Device>().Where(x => x.ParentId == group.ID).Include(x => x.DeviceVariables).Include(x => x.DeviceConfigs).OrderBy(x => x.Index))
|
||||
foreach (var device in DC.Set<Device>().AsNoTracking().Where(x => x.ParentId == group.ID).Include(x => x.DeviceVariables).Include(x => x.DeviceConfigs).OrderBy(x => x.Index).ToList())
|
||||
{
|
||||
FolderState staticFolder = CreateFolder(deviceGroupFolder, device.DeviceName, device.DeviceName);
|
||||
foreach (var variable in device.DeviceVariables)
|
||||
|
Loading…
Reference in New Issue
Block a user