Objects are typically not isolated entities; they exist in relationship to other objects. The three principle relationships in object oriented programming are is-a, has-a, and relates-to. The first is modeled through inheritance, the second through composition, and the third through method calls.
Not surprisingly, the heart of relational databases is relations; in this case, modeled by foreign key relationships.
Mapping from object relationships to relational database relationships is the main objective of LINQ to SQL.
We can model the relationship between the Customer class and the Order class more explicitly by the use of attributes in both classes. For example, we can mark up the Customer class ...