public class Where_LINQ { public static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); public static void Print() { DataContext context = new DataContext(ContextString); Table<Contact> contact = context.GetTable<Contact>(); var whereQuery = from c in contact where c.FirstName.StartsWith("S") select new { c.FirstName, c.LastName, c.EmailAddress }; foreach (var item in whereQuery.Take(10)) { Console.WriteLine(item.FirstName + " " + item.LastName + " " + item.EmailAddress); } Console.WriteLine("\n"); Console.WriteLine("===== Method Syntex ====="); var whereMethodSyntex = contact.Select(con => new { con.FirstName, con.LastName, con.EmailAddress }).Where(c => c.FirstName.StartsWith("S")); foreach (var i in whereMethodSyntex.Take(10)) { Console.WriteLine(i.FirstName + " " + i.LastName + " " + i.EmailAddress); } Console.ReadKey(); } }