Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brijbaroda/eeaaae27d591bfcfbcc96487977e8be3 to your computer and use it in GitHub Desktop.
Save brijbaroda/eeaaae27d591bfcfbcc96487977e8be3 to your computer and use it in GitHub Desktop.
public class ConfigureServiceApiBlock : PipelineBlock<ODataConventionModelBuilder, ODataConventionModelBuilder, CommercePipelineExecutionContext>
{
public override Task<ODataConventionModelBuilder> Run(ODataConventionModelBuilder modelBuilder, CommercePipelineExecutionContext context)
{
Condition.Requires(modelBuilder).IsNotNull($"{this.Name}: The argument cannot be null.");
// Add unbound actions
var configuration = modelBuilder.Action("ImportSellableItems");
configuration.ReturnsFromEntitySet<CommerceCommand>("Commands");
var configurationInventory = modelBuilder.Action("ImportInvenotrySellableItems");
configurationInventory.ReturnsFromEntitySet<CommerceCommand>("Commands");
return Task.FromResult(modelBuilder);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment