linq - Join With List Collection -
i try write join linq query. it's raise syntax error. can do? need user's conversation messages.
/* conversations = header info c.users = list<applicationuser> */ public list<conversationmessage> getall(applicationuser user) { var query = m in _db.conversationmessages join c in _db.conversations on m.conversationid equals c.conversationid join u in _db.users on c.users.contains(user) select m; }
it seems me should more this:
public list<conversationmessage> getall(applicationuser user) { var query = c in _db.conversations c.users.contains(user) join m in _db.conversationmessages on c.conversationid equals m.conversationid select m; return query.tolist(); }
Comments
Post a Comment