Unino合并集合出错求解,明明都是18列啊
var list = (from a in LinqDBContext.Eventinfos
from b in LinqDBContext.GatewaySystemInfo
from c in LinqDBContext.site
from d in LinqDBContext.devices
from e in LinqDBContext.flatpic
from h in LinqDBContext.onlineorg
from dt in LinqDBContext.devicetype
from f in LinqDBContext.firesystype
where a.Gatewayaddress == b.Gatewayaddress && b.siteid == c.siteid && c.orgid == h.orgid && h.orgid == orgid && a.Gatewayaddress == d.Gatewayaddress
&& a.deviceaddress == d.deviceaddress && a.sysaddress == b.Sysaddress && a.sysaddress == d.Sysaddress && e.siteid == c.siteid && e.cFlatPic == d.cFlatPic && a.cAlarmtype == "XX"
&& dt.iDeviceType == d.iDeviceType && dt.tiSysType == f.tiSysType
select new
{
a.Firealarmid,
a.cAlarmtype,
h.orgname,
c.sitename,
a.Gatewayaddress,
vdesc = string.IsNullOrEmpty(f.vSysdesc) ? "" : f.vSysdesc,
deviceaddress = string.IsNullOrEmpty(d.deviceaddress) ? "" : d.deviceaddress,
a.AlarmNum,
vfireroomtel = string.IsNullOrEmpty(h.vfireroomtel) ? "" : h.vfireroomtel,
e.floornum,
d.location,
a.dFirstAlarmtime,
a.dReceivetime,
a.sysaddress,
DeviceTypeName = dt.DeviceTypeName,
imFlatPic = FirePicUrl + e.imFlatPic,
x = string.IsNullOrEmpty(d.fPositionX + "") ? 0 : (float)d.fPositionX / 950,
y = string.IsNullOrEmpty(d.fPositionY + "") ? 0 : (float)d.fPositionY / 500
});
var GateWayList = (from a in LinqDBContext.Eventinfos
from b in LinqDBContext.GatewaySystemInfo
from c in LinqDBContext.site
from h in LinqDBContext.onlineorg.Where(x => x.orgid == c.orgid).Distinct().DefaultIfEmpty()
where a.Gatewayaddress == b.Gatewayaddress && b.siteid == c.siteid &&a.sysaddress==null&&a.deviceaddress==null&&a.cAlarmtype=="XX"
select new
{
a.Firealarmid,
a.cAlarmtype,
h.orgname,
sitename="",
a.Gatewayaddress,
vdesc = "",
deviceaddress = "",
a.AlarmNum,
vfireroomtel = string.IsNullOrEmpty(h.vfireroomtel) ? "" : h.vfireroomtel,
floornum = "",
location = "",
a.dFirstAlarmtime,
a.dReceivetime,
a.sysaddress,
DeviceTypeName = "",
imFlatPic = "",
x = (float)0,
y = (float)0
});
if (GateWayList.Count()>0)
{
list=list.Union(GateWayList.Distinct());
}
float AllCount = list.Count();
这里报错:使用 UNION、INTERSECT 或 EXCEPT 运算符合并的所有查询必须在其目标列表中有相同数目的表达式。