Reputation: 13
I have the following code:
var attr = from a in ClsT.Current.GetValues()
from b in a.SomeMethod()
where typeof(ClsA).SomeOtherMethod(b)
select b;
How can I convert it to => notation?
Upvotes: 0
Views: 155
Reputation: 2968
The equivalent code would be:
var attr = ClsT.Current.GetValues()
.SelectMany(a => a.SomeMethod())
.Where(b => typeof(ClsA).SomeOtherMethod(b);
Upvotes: 1
Reputation: 136114
Perhaps:
ClsT.Current.GetValues().SomeMethod().Where(b => typeof(ClsA).SomeOtherMethod(b))
Upvotes: 0
Reputation: 25563
This would be
ClsT.Current.GetValues().SelectMany(a => a.SomeMethod())
.Where(b => typeof(ClsA).SomeOtherMethod(b));
Upvotes: 1