c# - LinQ Error linq joint type inference failed to call 'join' error -


i'm quite new entity framework , i'm trying use join clause on 2 entities follows.

var alertlist = elogalert  in yangkeedbentity.yang_kee_logistics_pte_ltd_elog_tablet_alert                         elogalert.no_ != null                         join elogalertdetail in  yangkeedbentity. yang_kee_logistics_pte_ltd_elog_tablet_alert_details                         on elogalert.no_ == elogalertdetail.alertid                            elogalertdetail.employee_id == driverid                         select new                         {                             elogalertdetail.employee_id,                             elogalertdetail.alert_id,                             elogalertdetail.no_,                             elogalertdetail.status,                             elogalertdetail.created_by,                             elogalertdetail.date_created,                            }; 

hi above code i'm getting 2 errors saying

'error  1   name 'elogalertdetail' not in scope on left side of 'equals'.  consider swapping expressions on either side of 'equals'.' , 'linq joint type inference failed call 'join' error  ' 

currently 2 tables not have data. ill happy if can me situation

you cant use == when joining linq. need use equals.

note not method .equals(..) keyword

from elogalert  in yangkeedbentity.yang_kee_logistics_pte_ltd_elog_tablet_alert join elogalertdetail in  yangkeedbentity.yang_kee_logistics_pte_ltd_elog_tablet_alert_details  on elogalert.no_ equals elogalertdetail.alertid //this line has equals instead of ==                          elogalert.no_ != null                         elogalertdetail.employee_id == driverid                         select new                         {                             elogalertdetail.employee_id,                             elogalertdetail.alert_id,                             elogalertdetail.no_,                             elogalertdetail.status,                             elogalertdetail.created_by,                             elogalertdetail.date_created,                         }; 

look @ documentaion on linq join


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -