Joining Using the join Clause

Data is often part of a bigger picture with many interrelated data sources, as seen in relational databases. In such a world, queries often target multiple data sources simultaneously, by joining those on a certain criterion. In relational database technologies, this is usually realized by giving data records a unique identifier, which is referred to as a primary key. To refer to a data record from another table, a column is designated as a foreign key referring to the related table’s primary key.

Figure 19.31 shows such a relationship, sometimes also referred to as an association, in the context of LINQ to SQL. In this particular case, one category can have many products associated with it, hence the OneToMany

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.