Using the LINQ First extension method

As the title says, this is a very simple example of how to use the First extension method. In the example below, ListOfClasses is a List<ScottsClass>, and I am trying to find the ScottsClass with an ID of 1:

ScottsClass Mine = ListOfClasses.First(i => i.ID == 1);

That is all there is to it.

Advertisements
  1. Tweets that mention Using the LINQ First extension method « Scott Stoecker's Blog -- Topsy.com

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: