I saw many articles on join in lambda expression format but i got an error in join.
I have two table one is tbl_payment
and another is tbl_bill
.
tbl_bank
has ID
(Primary Key), BILL_TYPE
.
tbl_payment
has ID
(Primary Key),AMT
,BILL_ID
(Foreign Key of tbl_bank
).
I want to get all data form tbl_payment
and bill_type from tbl_bill
in one query result.
Code :
ViewBag.requestHistory =
db.tbl_bill.Join(db.tbl_payment, x => x.ID, y => y.BILL_ID,
(x, y) => new {x.BILL_TYPE,y.ID,y.AMT,y.COMMENT,y.PAYMENT_METHOD,y.STATUS}).ToList();
It's gave an error :
The type arguments for method `Querable.Join<TOuter,.....> cannot be infrred from the usage`.