Need help converting SQL to EF4 please

Posted by Ken Eldridge on Stack Overflow See other posts from Stack Overflow or by Ken Eldridge
Published on 2010-12-23T05:11:25Z Indexed on 2010/12/23 5:54 UTC
Read the original article Hit count: 250

Filed under:
|

I need help converting this SQL statement, into EF4:

Select Posts.PostID, Post, Comment
from Posts left join
 Comments on posts.PostID = Comments.PostID
    Where CommentID not in 
    (
     Select PostID
     from Votes
     where VoteTypeID = 4 --4 = flagged comment type
    )

In my database, the Votes table stores either the PostID of reported posts, or CommentID of reported comments in the column Votes.PostID

Thanks in advance!

© Stack Overflow or respective owner

Related posts about sql

Related posts about entity-framework