This documentation is archived and is not being maintained.

How to: Convert a Sequence to a Generic List (LINQ to SQL)

Use ToList<TSource> to create a generic List from a sequence.

The following sample uses ToList<TSource> to immediately evaluate a query into a generic List<T>.

var empQuery =
    from emp in db.Employees
    where emp.HireDate >= new DateTime(1994, 1, 1)
    select emp;
    List<Employee> qList = empQuery.ToList();