Skip to content
Skip to content
sujatad.net

Blogging about technology and leadership

← Asp.net applications – data access in a database agnostic data way
WCF webcast series →
-->

Learning LINQ

Posted on June 1, 2007 by sujatad

Learning LINQ and the various nuances, including how C# 3.0 features are leveraged.

Anonymous Types
var test = new {Field1=value1, Field2=value2};
var fullName = new {FirstName=”Susan”, LastName=”Howe”};

Extension Methods

List customers = new List();
customers.Add(new Customer(1,”Roger”,”Minnesota”));
customers.Add(new Customer(2,”Susan”,”San Francisco”));
customers.Add(new Customer(3,”Hector”,”New York”));
var abe = collection.Single(c => c.Name.Equals(“Hector”));

Lambda Expressions

(int i) => {return i > 2};

var results = from p in Process.GetProcesses() where p.Threads.Count > 6 select new {p.ProcessName, ThreadCount = p.Threads.Count, p.Id };

About sujatad

Technical Blogger
View all posts by sujatad
This entry was posted in LINQ. Bookmark the <a href="https://sujatad.net/linq/learning-linq/" title="Permalink to Learning LINQ" rel="bookmark">permalink</a>.
← Asp.net applications – data access in a database agnostic data way
WCF webcast series →

Comments are closed.

© 2025 | Blog info WordPress Theme | By Bharat Kambariya