Domain Specific Language with Fluent API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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