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
Post a Comment