public class Student
{
public int StudentId { get; set; }
public string StudentName { get; set; }
public virtual List<Course> Courses { get; set; }
}
public class Course
{
public int CourseId { get; set; }
public string CourseName { get; set; }
}
public List<student> GetStudentList()
{
List<student> objStudents = new List<student>()
{
new Student {
StudentId = 1,
StudentName = "Prasasd",
Courses = new List<course> {new Course{ CourseId=101, CourseName="Java"}, new Course{ CourseId=102, CourseName="DotNet"}}
},
new Student {
StudentId = 2,
StudentName = "Ram",
Courses = new List<course> {new Course{ CourseId=101, CourseName="Java"}, new Course{ CourseId=102, CourseName="DotNet"}}
}
};
return objStudents;
}</course></course></student></student></student>