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
goraz abz
NA
2
487
Query & SubQuery LINQ MVC
Apr 18 2018 12:33 AM
Hi,
Iam working on website which is about Fitnesse using Web API and I have page which is should display Session and in Every Session I should loop & display Session Items under Every Session, For ex in Program 1 ,have Two Session (Monday[loop SessionItem] & Saturday[loop SessionItem]) AND Program 2 ,have One Session (Wednesday[loop SessionItem])
BUT, When i Check Results in PostMan its like this :
Program 1 > Session (Monday,Saturday,Wednesday)
Program 2 > Session (Monday,Saturday,Wednesday)
But It Should like this :
Program 1 > Session (Monday [loop SessionItem], Saturday [loop SessionItem])
Program 2 > Session (Saturday [loop SessionItem])
This is My Code:
[HttpGet]
public
IHttpActionResult SessionInSessionItem(
int
id) {
var data4 = db.Session.Select(m =>
new
{
Session = m.Name,
SesseionItem = from y in db.Sessionjoin si in db.SessionItem on
y.ID equals si.SessionID
where
si.SessionID == m.ID
select
new
{
si.SessionID ,
y.Name,
si.Pause,
si.Reps¨
}
}).ToList();
if
(data4 == null) {
return
NotFound();
}
return
Ok(data4); }
Can someone please point me in right direction :)Thanks.
Reply
Answers (
0
)
Sort data in numeric first and then varchar format
issue in Ajax call while uploading excel file