.net - LINQ sample: select typed objects from a list -
.net - LINQ sample: select typed objects from a list -
i have
dim objectslist list(of object) = getallobjects() ' filter objects persons ' dim peoplelist list(of person) = ??? what efficient , effective linq look it?
edit
1 dim selectedobjects list(of object) = getallobjects() 2 dim selectedpeople ienumerable(of person)= selectedobjects.oftype(of person) 3 dim people list(of person) = selectedpeople.tolist() error on 3:
value of type 'system.collections.generic.list(of system.collections.generic.ienumerable(of person))' cannot converted 'system.collections.generic.list(of person)'.
sounds want enumerable.oftype():
dim peoplelist list(of person) = objectslist.oftype(of person)().tolist() .net vb.net linq
Comments
Post a Comment