Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Accessing Data
ADO.NET
Feature Reference
Entity Data Model
EDM Specifications
 Complex Type
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Complex Type (EDM)

The ComplexType in the Entity Data Model (EDM) is a data type with internal structure but without a Key property. The ComplexType is used to implement a property that has internal properties of its own.

Either an EntityType or a ComplexType can have a property declared as ComplexType. This property must be mapped as a complex property in the mapping specification.

The Address property of the following CCustomer entity is implemented as ComplexType.

<EntityType Name="CCustomer">
  <Key>
    <PropertyRef Name="CustomerId" />
  </Key>
  <Property Name="CustomerId" Type="Int32" Nullable="false" />
  <Property Name="CompanyName" Type="String" />
  <Property Name="ContactName" Type="String" />
  <Property Name="ContactTitle" Type="String" />
  <Property Name="Address" Type="Self.CAddress" Nullable="false" />
</EntityType>

<ComplexType Name="CAddress">
  <Property Name="StreetAddress" Type="String" />
  <Property Name="City" Type="String" />
  <Property Name="Region" Type="String" />
  <Property Name="PostalCode" Type="String" />
  <Property Name="Country" Type="String" />
  <Property Name="Phone" Type="String" />
  <Property Name="Fax" Type="String" />
</ComplexType>

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker