O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required