I want all the students who belongs to 'xyz' course in following format
Class MyStudent
string StudentName String [] Groups
Each stuent can be member of one or more groups and i need to populate "Class MyClass" in my LINQ query so that it holds StudentName and List of Groups in each object.
Can you please suggest a LINQ query that can do so
2) Also you can try to create a manual EntityFramework model and then with the help of the Stored Procdure and then do to fetch values to map to the entity model.
comsian_atd
0 Points
6 Posts
LINQ Query Help required
Jan 04, 2013 10:12 AM|LINK
Table 1: Student
StudentID StudentName
Table 2: Course
CourseID CourseName
Table 3: Group
GroupID GroupName
Table 4: StudentCourseGroup
StudentID CourseID GroupID
I want all the students who belongs to 'xyz' course in following format
Class MyStudent
string StudentName String [] Groups
Each stuent can be member of one or more groups and i need to populate "Class MyClass" in my LINQ query so that it holds StudentName and List of Groups in each object.
Can you please suggest a LINQ query that can do so
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: LINQ Query Help required
Jan 05, 2013 02:07 AM|LINK
Hello,
Not every complicated SQL can be converted to LINQ.
For this problem, I suggest you:
1) Try to write down a normal SQL staement and then convert it to linq with the help of this tool:
http://www.sqltolinq.com/downloads
2) Also you can try to create a manual EntityFramework model and then with the help of the Stored Procdure and then do to fetch values to map to the entity model.
Reguards!