©2009 Microsoft Corporation. All rights reserved.
C# Language Reference
on (C# Reference)

Updated: July 2008

The on contextual keyword is used in the join clause [ http://msdn.microsoft.com/en-us/library/bb311040.aspx ] of a query expression to specify the join condition.

The following example shows the use of on in a join clause.

C#
var innerJoinQuery =
    from category in categories
    join prod in products on category.ID equals prod.CategoryID
    select new { ProductName = prod.Name, Category = category.Name }; 

Concepts

LINQ Query Expressions (C# Programming Guide) [ http://msdn.microsoft.com/en-us/library/bb397676.aspx ]

Other Resources

C# Reference [ http://msdn.microsoft.com/en-us/library/618ayhy6.aspx ]

Date

History

Reason

July 2008

Added topic.

Information enhancement.

Tags: 
 
Community Content