Skip to content

Instantly share code, notes, and snippets.

@cx20
Created June 10, 2012 14:34
Show Gist options
  • Save cx20/2905943 to your computer and use it in GitHub Desktop.
Save cx20/2905943 to your computer and use it in GitHub Desktop.
Hello, LINQ World!
using System;
using System.Linq;
using System.Collections.Generic;
class Record
{
public string Message;
public Record(string message)
{
this.Message = message;
}
}
class Hello
{
static void Main(string[] args)
{
Record[] records = new Record[]
{
new Record("Hello, LINQ World!")
};
IEnumerable<Record> query =
from n in records
select n;
foreach (Record r in query)
{
Console.WriteLine(r.Message);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment