This documentation is archived and is not being maintained.

ComplexProperty Element (MSL)

A ComplexProperty element in mapping specification language (MSL) defines the mapping between a complex type property on a conceptual model entity type and table columns in the underlying database. The property-column mappings are specified in child ScalarProperty elements.

The ComplexType property element can have the following child elements:

Applicable Attributes

The following table describes the attributes that are applicable to the ComplexProperty element:

Attribute Name Is Required Value



The name of the complex property of an entity type in the conceptual model that is being mapped.



The namespace-qualified name of the conceptual model property type.


The following example is based on the School model. The following complex type has been added to the conceptual model:

<ComplexType Name="FullName">
  <Property Type="String" Name="LastName" 
            Nullable="false" MaxLength="50" 
            FixedLength="false" Unicode="true" />
  <Property Type="String" Name="FirstName" 
            Nullable="false" MaxLength="50" 
            FixedLength="false" Unicode="true" />

The LastName and FirstName properties of the Person entity type have been replaced with one complex property, Name:

<EntityType Name="Person">
    <PropertyRef Name="PersonID" />
  <Property Name="PersonID" Type="Int32" Nullable="false" 
            annotation:StoreGeneratedPattern="Identity" />
  <Property Name="HireDate" Type="DateTime" />
  <Property Name="EnrollmentDate" Type="DateTime" />
  <Property Name="Name" Type="SchoolModel.FullName" Nullable="false" />

The following MSL shows the ComplexProperty element used to map the Name property to columns in the underlying database:

<EntitySetMapping Name="People">
  <EntityTypeMapping TypeName="SchoolModel.Person">
    <MappingFragment StoreEntitySet="Person">
      <ScalarProperty Name="PersonID" ColumnName="PersonID" />
      <ScalarProperty Name="HireDate" ColumnName="HireDate" />
      <ScalarProperty Name="EnrollmentDate" ColumnName="EnrollmentDate" />
      <ComplexProperty Name="Name" TypeName="SchoolModel.FullName">
        <ScalarProperty Name="FirstName" ColumnName="FirstName" />
        <ScalarProperty Name="LastName" ColumnName="LastName" />  

See Also