Compartilhar via


EndProperty Element (MSL)

The EndProperty element in mapping specification language (MSL) defines the mapping between an end or a modification function of a conceptual model association and the underlying database. The property-column mapping is specified in a child ScalarProperty element.

When an EndProperty element is used to define the mapping for the end of a conceptual model association, it is a child of an AssociationSetMapping element. When the EndProperty element is used to define the mapping for a modification function of a conceptual model association, it is a child of an InsertFunction element or DeleteFunction element.

The EndProperty element can have the following child elements:

Applicable Attributes

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

Attribute Name Is Required Value

Name

Yes

The name of the association end that is being mapped.

Example

The following example shows an AssociationSetMapping element in which the FK_Course_Department association in the conceptual model is mapped to the Course table in the database. Mappings between association type properties and table columns are specified in child EndProperty elements.

<AssociationSetMapping Name="FK_Course_Department" 
                       TypeName="SchoolModel.FK_Course_Department" 
                       StoreEntitySet="Course">
  <EndProperty Name="Department">
    <ScalarProperty Name="DepartmentID" ColumnName="DepartmentID" />
  </EndProperty>
  <EndProperty Name="Course">
    <ScalarProperty Name="CourseID" ColumnName="CourseID" />
  </EndProperty>
</AssociationSetMapping>

Example

The following example shows the EndProperty element mapping the insert and delete functions of an association (CourseInstructor) to stored procedures in the underlying database. The functions that are mapped to are declared in the storage model.

<AssociationSetMapping Name="CourseInstructor" 
                       TypeName="SchoolModel.CourseInstructor" 
                       StoreEntitySet="CourseInstructor">
  <EndProperty Name="Person">
    <ScalarProperty Name="PersonID" ColumnName="PersonID" />
  </EndProperty>
  <EndProperty Name="Course">
    <ScalarProperty Name="CourseID" ColumnName="CourseID" />
  </EndProperty>
  <ModificationFunctionMapping>
    <InsertFunction FunctionName="SchoolModel.Store.InsertCourseInstructor" >   
      <EndProperty Name="Course">
        <ScalarProperty Name="CourseID" ParameterName="courseId"/>
      </EndProperty>
      <EndProperty Name="Person">
        <ScalarProperty Name="PersonID" ParameterName="instructorId"/>
      </EndProperty>
    </InsertFunction>
    <DeleteFunction FunctionName="SchoolModel.Store.DeleteCourseInstructor">
      <EndProperty Name="Course">
        <ScalarProperty Name="CourseID" ParameterName="courseId"/>
      </EndProperty>
      <EndProperty Name="Person">
        <ScalarProperty Name="PersonID" ParameterName="instructorId"/>
      </EndProperty>
    </DeleteFunction>
  </ModificationFunctionMapping>
</AssociationSetMapping>

See Also

Concepts

Association Element (CSDL)
ModificationFunctionMapping Element (MSL)

Other Resources

CSDL, SSDL, and MSL Specifications
Modeling and Mapping