In this article we use a model created with the help of Entity Developer (read more about it in the section Using Entity Developer) or created manualy (read more about it in the section Creating LinqConnect Classes Manually).
Each database table is represented as a Table collection, accessible via the GetTable() method using its entity class to identify it. It is recommended that you declare a strongly typed DataContext instead of relying on the basic DataContext class and the GetTable() method. A strongly typed DataContext declares all Table collections as members of the context.
Note: |
---|
To run samples from this article include the following namespace before your code: |
Use the following examples for data extracting:
The query for companies from Boston can be expressed in a simpler way:
You can read more about LINQ queries in the Querying Across Relationships topic