I am creating a test repository for dependency injection and i have my test method below.
private List<object> records;
public IList<T> GetFiltered<T>(Expression<Func<T, bool>> action = null) where T : class
{
return ((List<T>)records).Where(action).ToList();
}
I essentially want to return a filtered list of records where the "action" condition is true.
I get the error below
Error 2 Instance argument: cannot convert from 'System.Collections.Generic.List' to 'System.Linq.IQueryable'
Please help.