demo
public async Task<GatGatewayDetailInfo> GetGatewayDetailInfo(int gatewayId)
{
#region 获取网关详情
var detail = new GatGatewayDetailInfo();
await Task.Run(() =>
{
Parallel.Invoke(
async () =>
{
detail.GatGatewayBasicInfo = await GetGatewayBasicExtInfo(gatewayId);
},
async () =>
{
detail.GatDeviceValvesList = await _deviceDal.GetListByValves(gatewayId);
},
async () =>
{
detail.GatDeviceSensorFertilizerList = await _deviceDal.GetListBySensor(gatewayId, 4);
},
async () =>
{
detail.GatDeviceSensorWaterList = await _deviceDal.GetListBySensor(gatewayId, 3);
}
);
});
return detail;
#endregion
}