I have a Collection of Data and the Dictionary:
- Collection handle Student Data
- Dictionary Keeps Student Courses.
I want to get the Course Name from the Dictionary and put it into as CourseName.
private viod GenerateStudentDetails(Student studentData) { var courses = m_courses.GetCoursesDictionary(); // returns Dictionary<Guid,string>() var studentDetails= from data in studentData select new { FirstName = data.FirstName, LastName = data.LastName, Email = data.Email, Mobile = data.Profile.Mobile, City = data.Profile.City, PostCode = data.Profile.PostCode, CourseName = courses[data.Profile.CourseID ?? Guid.Empty] }; } "LINQ to Entities does not recognize the method 'System.String get_Item(System.Guid)' method, and this method cannot be translated into a store expression."