Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a C# LINQ syntax for the Queryable.SelectMany() method?

When writing a query using C# LINQ syntax, is there a way to use the Queryable.SelectMany method from the keyword syntax?

For

string[] text = { "Albert was here",                    "Burke slept late",                    "Connor is happy" }; 

Using fluent methods I could query

var tokens = text.SelectMany(s => s.Split(' ')); 

Is there a query syntax akin to

var tokens = from x in text selectmany s.Split(' ') 
like image 567
BrianCooksey Avatar asked Jun 20 '11 17:06

BrianCooksey


People also ask

Why does AC have a slash?

Why is there a slash between A and C in A/C? AC is used as an abbreviation for alternating current and A/C for air conditioning. For most people AC is used for alternating current because it was the first use of this abbreviation and A/C is used for air conditioning to differentiate from alternating current.

What is AC?

What A/C Means. The term “A/C” stands for “air conditioning,” but it's frequently used to describe any type of home cooling equipment, such as a traditional split-system air conditioner or heat pump, mini-split unit, geothermal system, or even a window unit.

Which is correct AC or AC?

Senior Member. A/C unit (air conditioning unit) is a single machine. (e.g. What's that ugly box on your wall? - It's the air conditioning unit.) A/C (air conditioning) is the entire system, or the result it gives.

Why was the air conditioner invented?

Willis Carrier invents first modern electrical air conditioning unit as a way to solve a moisture problem for a publishing company.


1 Answers

Yes, you just repeat the from ... in clause:

var words = from str in text             from word in str.Split(' ')             select word; 
like image 177
driis Avatar answered Sep 17 '22 00:09

driis