C# Joins/Where with Linq and Lambda
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-05-04T17:53:38Z
Indexed on
2010/05/04
17:58 UTC
Read the original article
Hit count: 320
Hello, I'm having trouble with a query written in Linq and Lambda. So far, I'm getting allot of errors here's my code:
int id = 1;
var query = database.Posts.Join(database.Post_Metas,
post => database.Posts.Where(x => x.ID == id),
meta => database.Post_Metas.Where(x => x.Post_ID == id),
(post, meta) => new { Post = post, Meta = meta });
I'm new to using Linq, so I'm not sure if this query is correct.
© Stack Overflow or respective owner