c# - Lambda Statement -



c# - Lambda Statement -

i wondering if there improve way of accomplishing this;

i have object - 1 of property dictionary. have set of comma separated values. need filter dictionary , elements dictionary value matches @ to the lowest degree 1 of values

this have tried there shorter way of doing this?

just explain: filtervalue list of values(e.g. "4,5')

list<string> vals = new list<string>(); vals.addrange(filtervalue.split(new char[]{','})); list<t> bindingentities = entities.where( e => { foreach(keyvaluepair<string, object> kvp in e.extraproperties) { if(vals.contains(kvp.value.tostring())) homecoming true; } homecoming false; }).tolist();

you can utilize any function:

list<string> vals = new list<string>(); vals.addrange(filtervalue.split(new char[] { ',' })); var bindingentities = entities.where( e => e.extraproperties.any( kvp => vals.contains(kvp.value.tostring()))).tolist();

c# lambda

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -