Maybe better than Leonid:
private BindingSource _bs;
private List<Entity> _list;
_list = context.Entities;
_bs.DataSource = _list;
Now that filtering is required:
_bs.DataSource = _list.Where<Entity>(e => e.cityID == 1).ToList<Entity>;
This way you save the original list (which is retrieved once from the context), and then use this original list for the query in memory (without going to the database). Thus, you can fulfill all kinds of queries according to your initial list.
source
share