Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
subQuery using Linq
S VK
Oct 26 2017 12:28 PM
234
Reply
// sql
returns
records
SELECT
*
FROM
InfoDetails
WHERE
InfoId =(
SELECT
tOP
1 InfoId
FROM
InfoMaster
WHERE
recordid=1
ORDER
BY
CreationDate
DESC
)
//
returns
0 records
db.InfoDetails.
Where
(u => u.InfoId ==(db.InfoMaster
.
Where
(x => x.recordid == Id).OrderByDescending(x => x.CreationDate).
Select
(x => x.InfoId).FirstOrDefault()))
.
Select
(t=> new InfoListViewModel
i need the above sql as linq lambda expression
sql returns reocrds but linq returns 0
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
c# Robust Ling Idea
c# Linq Take Selected Records