I have a List<Employees>
collection that I am trying to select Active
employees on.
I must be doing something wrong, because I see numerous examples on here showing that I can do this, yet Visual Studio is telling me I can not because:
Cannot implicitly convert type 'System.Linq.IOrderedEnumerable' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?)
What is wrong with this picture? LastName
and FirstName
(as you might suspect) are both String values, and Active
is a Boolean.
DataGridView1.DataSource = null;
List<AcpEmployee> emps = from e in employeeInfo.Employees
where e.Active
orderby e.LastName, e.FirstName descending
select e;