Skip to content

Instantly share code, notes, and snippets.

@Dheer-Rajpoot
Created March 31, 2017 07:25
Show Gist options
  • Save Dheer-Rajpoot/9dfe06945b5abe1d1b79aa32775d34f3 to your computer and use it in GitHub Desktop.
Save Dheer-Rajpoot/9dfe06945b5abe1d1b79aa32775d34f3 to your computer and use it in GitHub Desktop.
public class ReadXMLDataStepConverter : BasePipelineStepConverter<ItemModel>
{
// the id from the pipeline step template you created named Read XML Data Pipeline Step.
private static readonly Guid TemplateId = Guid.Parse("{00191A02-F1B4-406C-B3CB-60568CCDD6D3}");
public ReadXMLDataStepConverter(IItemModelRepository repository) : base(repository)
{
this.SupportedTemplateIds.Add(TemplateId);
}
protected override void AddPlugins(ItemModel source, PipelineStep pipelineStep)
{
AddEndpointSettings(source, pipelineStep);
}
private void AddEndpointSettings(ItemModel source, PipelineStep pipelineStep)
{
//create the endpoint settings
var settings = new EndpointSettings();
//populate the endpoint settings using values from the item
var endpointFrom = base.ConvertReferenceToModel<Endpoint>(source, ReadXMLDataStepItemModel.EndpointFrom);
if (endpointFrom != null)
{
settings.EndpointFrom = endpointFrom;
}
//add the endpoint settings to the pipeline step
pipelineStep.Plugins.Add(settings);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment