Andrew Davies created an excellent little class on sourceforge called BindingListView
which essentially allows you to bind a collection to a Data
Ok this is what I got: Here is my extension method :
public static class BindingViewListExtensions
{
public static void Where(this BindingListView list, Func function)
{
// I am not sure I like this, but we know it is a List
var lists = list.DataSource as List;
foreach (var item in lists.Where(function))
{
Console.WriteLine("I got item {0}", item);
}
}
}
And then I used it like :
List source = new List() { "One", "Two", "Thre" };
BindingListView binding = new BindingListView(source);
binding.Where(xx => xx == "One");
I guess where in the extension method could return the found item.