fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication5
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. var x = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  23. var y = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I"};
  24. var data = new[] {
  25. new {X = 0, Y = "A", Value = "0A"},
  26. new {X = 2, Y = "B", Value = "2B"},
  27. new {X = 5, Y = "F", Value = "5F"},
  28. new {X = 8, Y = "A", Value = "8A"}
  29. };
  30.  
  31. var result = from a in x
  32. from b in y
  33. join c in data.DefaultIfEmpty() on a + b equals c.X + c.Y into d
  34. let f = d.FirstOrDefault()
  35. select new { X = a, Y = b , Value = (f == null ? "" : f.Value) };
  36.  
  37. MessageBox.Show(string.Join("\r\n", result));
  38. }
  39. }
  40. }
  41.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(8,24): error CS0234: The type or namespace name `Tasks' does not exist in the namespace `System.Threading'. Are you missing an assembly reference?
prog.cs(9,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty