Language
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use ToList to create a generic List from a sequence.
Example
The following sample uses ToList 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();
Dim empQuery = _
From emp In db.Employees _
Where emp.HireDate.Value >= #1/1/1994# _
Select emp
Dim qList As List(Of Employee) = empQuery.ToList()