Instantly share code, notes, and snippets.

Embed
What would you like to do?
Domain Specific Language with Fluent API
public static IFunctionFactory Factory { get; set; } = new FunctionFactory(new AppModule());
[FunctionName(nameof(XmlToXmlMapperHttpTrigger))]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "mappers/xml/xml")] HttpRequestMessage req,
ILogger log)
{
return result = await Factory.Create<IXmlToXmlMapperFunction, ILogger>(log)
.InvokeAsync<HttpRequestMessage, HttpResponseMessage>(req)
.ConfigureAwait(false);
}
public static async Task<IXmlTransformHelper> AddArgumentsAsync(this Task<IXmlTransformHelper> helper, List<ExtensionObject> eos)
{
var instance = await helper.ConfigureAwait(false);
return await instance.AddArgumentsAsync(eos).ConfigureAwait(false);
}
var content = await this._helper
.LoadXslAsync(this._settings.Containers.Mappers, request.Mapper.Directory, request.Mapper.Name)
.AddArgumentsAsync(request.ExtensionObjects)
.TransformAsync(request.InputXml);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment