If only I were

Building Great Software

First LINQ query expression

leave a comment »

from u in Users
join b in Businesses on u.BusinessID equals b.ID
orderby b.ID
select new {u.LastName, b.BusinessName}

Wow, a basic query expression sure is easy.  And it’s very familiar if you’ve worked with any flavor if SQL. This is an incredibly simple example, but definitely cool.

The order of your clauses definitely shift and your table alias equivalents are a bit different, but barely worth mentioning.

Btw, I’m reading through the .Net Standard Query Operators spec and using LINQPad to get started learning LINQ.  I’ve never met Joseph Albahari, but he seems to be one smart guy.

Advertisements

Written by Chris Sutton

October 10, 2007 at 12:28 pm

Posted in Technology

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: