Yes, I do know the difference between a jagged array [][] and a multidimensional array [,].
Yes, I have looked for duplicates and found these:
- How to use LINQ on a multidimensional array to 'unwind' the array?
- Convert 2 dimensional array
- c# linq return a multidimensional array from linq
The last one of these contains a function to do the job. But my question is still: is there any way (no matter how contorted or contrived) to persuade LINQ to construct and return a result in the form of a multidimensional array (and not a jagged array)?
It's not really relevant to the question, but the problem that led here was one of those little jobs that looked like it was "made for LINQ", except that the function I needed to call had been defined with a multidimensional array parameter. The LINQ code to produce the answer as a jagged array took about 5 minutes to write, and then what? Did I miss something, or is there really no way for LINQ to do the job?
I supposed I should say: other than writing a chunk of code to do it the old way and embedding it as a lambda or calling it as an extension method. For now it does look as if LINQ can neither produce nor consume multidimensional arrays, and the answer to my question is no.