This is what i have now.
public ViewResult Index(string id)
{
var posts = db.Posts.Include(p => p.Blog.Id);
return View(posts.ToList());
}
this is returning all posts, how do i do the linq query to only give me postw with Blog.id == id
I believe you just need to filter your posts with .Where(). Below, I’m assuming Blog.Id is a string. If not you’ll have to cast appropriately.