C# Joins/Where with Linq and Lambda
- by David
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.