c# - Linq Error on Left outer join -
i have alert table has 1:many mapping devices. relationship conveyed ina mapping table. when try produce left outer join mapping table various asset type tables following error:system.security.verificationexception: operation destabilize runtime.
var alertassets = (from in dc.msalert_assets b in dc.msrfids.where(x => x.accountid == a.accountid && x.rfid == a.tagnum && x.custnum == a.custnum).defaultifempty() c in dc.msdevices.where(x => x.accountid == a.accountid && x.deviceid == a.deviceid).defaultifempty() d in dc.msgroups.where(x => x.accountid == a.accountid && x.groupid == a.groupid).defaultifempty() let x = grrepo.getassetsforgroupid(d.groupid, d.accountid) a.alertid == alertid select new {... specific objects}
i thought may narrowing issue, enumarated iqueryable, still same issue.
the 1 thing jumps out @ me line
let x = grrepo.getassetsforgroupid(d.groupid, d.accountid)
if d can null (since it's left outer join because of defaultifempty), how can access d.groupid or d.accountid. think failing since cannot properties/variables null.
Comments
Post a Comment