Important System.Data.Linq API Classes

There are a handful of classes in the System.Data.Linq namespace that you will use on a regular basis when using LINQ to SQL. The following section is meant to provide a brief overview of these classes, their purposes, and where they fit in the scheme of LINQ to SQL.

EntitySet<T>

An entity class on the one side of a one-to-many relationship stores its associated many entity classes in a class member of type EntitySet<T> where type T is the type of the associated entity class.

Since, in the Northwind database, the relationship between Customers and Orders is one-to-many, in the Customer class, the Orders are stored in an EntitySet<Order>.

private EntitySet<Order> _Orders;

The EntitySet<T> class is a special ...

Get Pro LINQ: Language Integrated Query in C# 2008 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.