Follow the link having good example:
Link 1
also you can directly use:
EXAMPLE
using (var ctx = new SchoolDBEntities())
{
var courseList = ctx.GetCoursesByStudentId(1).ToList<Course>();
foreach (Course cs in courseList)
Console.WriteLine("Course Name: {0}",cs.CourseName);
}