I have 2 tables, and I would like to join them using Lambda statements (not Linq but Lambda).
This is the query that I need:
SELECT
c.*
FROM
board as b
LEFT JOIN category as c ON
b.cid = c.cid
WHERE
b.bid = 1
How do I do this?
Say if board is a dataset/variable and category is an other dataset/variable then i want somethign like board.Join(category).Where(b=>b.bid==c.cid) ( i know this is wrong but just so you have an idea what i am looking for thank you so much for all your help
If you mean method syntax and not query syntax of linq then you can do
var results = context.boards.Where(b => b.bid == 1)
.DefaultIfEmpty()
.Join(context.categories,
b => b.bid,
c => c.cid,
(b, c) => c);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With