Explain the below Linq Query? -
results.where(x=>x.members.any(y=>members.contains(y.name.tolower())
i happened see query in internet. can explain query please.
suggest me linq tutorial newbie.
thank all.
edited:
what x , y stands for?
x
single result, of type of elements inresults
sequence.y
single member, of type of elements inx.members
sequence.
these lambda expressions (x => x.whatever
) introduced language c# 3, x
input, , right side (x.whatever
) output (in particular usage scenario).
an easier example
var list = new list<int> { 1, 2, 3 }; var oddnumbers = list.where(i => % 2 != 0);
here, i
single int
item input expression. i % 2 != 0
boolean expression evaluating whether input or odd. entire expression (i => % 2 != 0
) predicate, func<int, bool>
, input integer , output boolean. follow? iterate on query oddnumbers
, each element in list
sequence evaluated against predicate. pass become part of output.
foreach (var item in oddnumbers) console.writeline(item); // writes 1, 3
Comments
Post a Comment