Simple LINQ and List error: WhereListIterator`1[Task]’ to type ‘System.Collections.Generic.List`1[Task]’

You just need a .ToList() either directly on the query or when you return it. As in

var AllTasks = (from t in tasks
               where t.Status.ToString() == "Completed" || t.Status.ToString() == "Pending"
               select t).ToList();

Or

return AllTasks.ToList();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)