Using LINQ to SQL Joins, Cross Joins, and Outer Joins

The heart and soul of a relational database is the normalization of tables so that data is not duplicated (and thus, so that data is less subject to data corruption). A fairly simple example of this can be seen in the Orders table of the Northwind database. It would be simple and convenient to put each customer's data (name, address, etc.) into each order, but that would mean that the data for a given customer might be duplicated (perhaps many times over) throughout the Orders table.

What is done, instead, is to create a single record for each Customer in the Customers table, giving each record a unique ID (CustomerID). That ID is then used as a foreign key in the Orders table, allowing each ...

Get Programming Reactive Extensions and LINQ 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.