I am going to assume TContext is an Entity Framework DbContext and TEntity is an EF Entity.
The "Set" method returns a dataset from that table;
context.Set<TContext>().Where(filter).ToList();
So you are getting a list of TContext items from the table that holds TContext items. You are then doing a Where using the filter, but the filter is an expression that works on TEntity items
Expression<Func<TEntity, bool>> filter
so you are trying to filter TContext items by properties on TEntity and the two don't match. This is all ignoring the elephant in the room that you are using "Set" on a db context so that doesn't work anyway. I think what you meant to write was this;
public List<TEntity> GetList(Expression<Func<TEntity, bool>> filter = null)
{
using(var context = new TContext())
{
return filter == null ? context.Set<TEntity>().ToList() : context.Set<TEntity>().Where(filter).ToList();
}
}
Now the code makes sense as you are requesting a set of entities from a table and then filtering that list using an expression that relates to the entity. Now your types all match and make sense.