fork download
  1. public void Linq91()
  2. {
  3. List<Product> products = GetProductList();
  4.  
  5. var categories =
  6. from p in products
  7. group p by p.Category into g
  8. select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) };
  9.  
  10. ObjectDumper.Write(categories);
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,13): error CS0116: A namespace can only contain types and namespace declarations
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty