[Association(Name="FK_Orders_Customers", Storage="_Orders",
OtherKey="CustID", DeleteRule="NO ACTION")]
public EntitySet Orders
{
get { return this._Orders; }
set { this._Orders.Assign(value); }
}
...
}
Here, the Orders property is understood by the LINQ to SQL runtime engine as the member
that allows navigation
from the Customers table to the Orders table via the column defined by the
OtherKey named property. The EntitySet member variable is used to represent the one-to-many
nature of this particular relationship.
C H A P T E R 2 4
■
P R O G R A M M I N G W I T H T H E L I N Q A P I S
851
8849CH24.qxd 10/19/07 10:11 AM Page 851
Do'stlaringiz bilan baham: |