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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
GroupJoin Method Syntax C#
El Mahdi Archane
May 20
2016
Code
1.7
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
//Query : GroupJoin Method Syntax
var Result = courseList.GroupJoin(studentList,
C => C.CourseID,
S => S.CourseID,
(C, Students) =>
new
{
StudentList = Students,
CourseNames = C.CourseName
});
// Result
foreach
(var item
in
Result)
{
Console.WriteLine(item.CourseNames);
foreach
(var student
in
item.StudentList)
{
Console.WriteLine(student.StudentName);
}
}
Console.ReadKey();
Linq
GroupJoin