我需要用 linq 查询一个表,并将 linq 查询返回的行绑定到一个对象
WebChatDBDataContext dataContext = new WebChatDBDataContext();
var executiveSession= dataContext.ExecutiveSessions.FirstOrDefault(s => s.SessionId == httpcontext.Session.SessionID);
var talkerId = (from cRoom in dataContext.ChatRooms
where cRoom.ExecutiveId == executiveSession.ExecutiveSessionId
select cRoom.TalkerId
);
var msglst = from msgPool in dataContext.MessagePools
// I want to use talkerId from the previous query
where msgPool.TalkerId == ???
select msglst;
谢谢