Cast BindingList of interface to filter by dynamic linq query knowing the type

bindinglist dynamic-linq

Question

I have a bindinglist of type ISomething. That I need to filter with a dynamic linq query.

BindingList<ISomething> myList;
var myType = typeof(MyClass); (MyClass a class that implements ISomething)

I need to be able to cast to a bindinglist of myClass just by knowing the myType.

var result = myList.Cast<something?>.AsQueryable().Where("FilterOption=\"Filter\"");
1
0
5/7/2016 1:11:30 PM

Popular Answer

Your filter description would have to exist in the Interface as a method. ie Description()

0
5/8/2016 2:16:06 AM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow