Partilhar via


Example Step 3: Modify the Class-to-Pipeline Mapping

This topic describes how to update the mapping between runtime objects and the dictionary that pipelines use.

To update the OrderPipelineMappings.xml file

  1. Create a copy of the OrderPipelineMappings.xml file if you want to be able to revert to your original configuration. Edit the OrderPipelineMappings.xml file to perform the rest of this procedure.

  2. Update the type of object that the LineItems property of an OrderForm object refers to. For this example, change the value of the ReferTo attribute to "MyLineItem".

    The Class element for the OrderForm class will look as follows:

    <Class Name="OrderForm">
        <Collection 
            Name="LineItems" 
            DictionaryKey="items" 
            KeyType="SimpleList" 
            ReferTo="MyLineItem" />
        ...
    </Class>
    
  3. Change the name of the class. For this example, change the name of the LineItem class to "MyLineItem".

    The Class element for the MyLineItem class will look as follows:

    <Class Name="MyLineItem">
        ...
    </Class>
    
  4. Add the new property to the MyLineItem class. For this example, add a new Property element to the MyLineItem class. Provide the following attributes:

    Name

    Value

    Name

    "WidgetDescriptionProperty"

    DictionaryKey

    "widget_description_property"

    The LineItems Class element will look as follows:

    <Class Name="MyLineItem">
        <Property
            Name="WidgetDescriptionProperty"
            DictionaryKey="widget_description_property" />
        ...
    </Class>
    
  5. Save the OrderPipelineMappings.xml file.

See Also

Other Resources

How to Modify the OrderPipelineMappings.xml File

Orders Example: Extending the LineItem Class