Posts Tagged Linq
Interesting Linq Problem
Posted by Kinnar Shah in .NET, Technology on November 4, 2009
Check out the code below:
using System.Linq;
class Program
{
static void Main()
{
int[] data = { 1, 2, 3, 1, 2, 1 };
foreach (var m in from m in data orderby m select m)
System.Console.Write(m);
}
}
Now, the question is:
If valid, how?
If not valid, why?
(Source: Eric Lippert’s Blog)