Incorporating API changes into the OData model
When your customization includes API changes, you must create a pipeline block class named ConfigureServiceApiBlock , and register it in the IConfigureServiceApiPipeline pipeline. This is required to incorporate your changes and to register new entities with the OData model.
Follow best practices when incorporating API changes into the OData model:
-
Name the new pipeline block
ConfigureServiceApiBlock. -
Place the
ConfigureServiceApiBlockclass at the root of your plugin project folder. -
The
ConfigureServiceApiBlockclass must extend thePipelineBlockclass, and takeODataConventionModelBuilderas an input and output parameter. For example:RequestResponsepublic class ConfigureServiceApiBlock : pipelineBlock<ODataConventionModelBuilder, ODataConventionModelBuilder, CommercePipelineExecutionContext> -
Because the
ODataConventionModelBuilderclass is a Microsoft class, follow the Microsoft standard patterns and procedures when adding new entities and exposing new API methods. The Commerce Engine SDK provides many implementation examples.