Can 开发者_运维知识库anybody tell the equivalent LINQ syntax for this query in c#?
SELECT Users.UserName, UserStatus.StatusTitle, UserStatus.StatusDetails
FROM UserStatus
INNER JOIN Users ON UserStatus.UserId = Users.UserID
where Users.userid=3
OR users.userID in (
SELECT UserFriends.FriendId
FROM Users
INNER JOIN UserFriends ON Users.UserID = UserFriends.UserId
where Users.userid=3 )
(from status in UserStatus
join user in Users ON status.UserID equals user.UserID
where user.UserID == 3 ||
( from u in users
join friends in UserFriends on u.UserID equals friends.UserID where u.UserID == 3
select friends.FriendId).Contains(user.UserID)
select new {user.UserName, status.StatusTitle, status.StatusDetails});
精彩评论