Partilhar via


Example Step 5: 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. Change the name of the OrderForm class to "MyOrderForm".

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

    <Class Name="MyOrderForm">
        ...
    </Class>
    
  3. Add the GiftCertificates property to the MyOrderForm class. Since the GiftCertificates property represents a collection of VirtualGiftCertificate objects, use the Collection element.

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

    <Class Name="MyOrderForm">
    <Collection
        Name="GiftCertificates"
        DictionaryKey="gift_certificates"
        KeyType="SimpleList"
        ReferTo="VirtualGiftCertificate" />
        ...
    </Class>
    
  4. Define the VirtualGiftCertificate class.

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

    <Class Name="VirtualGiftCertificate">
        <Property
            Name="VirtualGiftCertificateId"
            DictionaryKey="VirtualGiftCertificateId"
            ClassKey="true" />
            ...
    </Class>
    
  5. Save the OrderPipelineMappings.xml file.

See Also

Other Resources

How to Modify the OrderPipelineMappings.xml File

Orders Example: Adding Virtual Gift Certificates