c# - Search in BindingList<T> with Linq -


why warning?

bindinglist<classname> lst = list.select(obj => obj.number == "nn").tolist<classname>(); 

.................................................

list:

bindinglist<classname> list = new bindinglist<classname>(); 

erro:

system.collections.generic.ienumerable' not contain definition 'tolist' , best extension method overload 'system.linq.enumerable.tolist(system.collections.generic.ienumerable)' has invalid arguments

do mean where instead of select?

list.select(obj => obj.number == "nn") 

is projection each item in list returns string "nn" - have sequence of n-times-"nn"; try force list of classname. further attempt cast list<classname> bindinglist<classname>, there no relationship between them other ilist<t>

i expect mean:

bindinglist<classname> lst = new bindinglist<classname>(         list.where(obj => obj.number == "nn").tolist()); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -