TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
S VK
NA
18
0
subQuery using Linq
Oct 26 2017 12:28 PM
// 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
Reply
Answers (
4
)
c# Robust Ling Idea
c# Linq Take Selected Records