I am not very experienced in SQL. I am using SQL Server 2008, and MVC3; have a simple view in my Database, trying to make a list using the following script:
List<vw_LearnerCourse> list = ctx.vw_LearnerCourses.Where(x => x.Course_ID == id).ToList().AsEnumerable();
I get the following error:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<vw_LearnerCourse>' to 'System.Collections.Generic.List<vw_LearnerCourse>'. An explicit conversion exists (are you missing a cast?)
Would appreciate your assistance. Thanks in advance.
Call
.ToList()on the IEnumerable.From the documentation: