예제 #1
0
 /// <summary>
 /// Initialises a new instance of the <see cref="TaskExecutor" /> class.
 /// </summary>
 /// <param name="apiOperationExecutor">The API operation executor that can handle incoming background tasks.</param>
 /// <param name="rootServiceProvider">The root <see cref="IServiceProvider" /> of the application.</param>
 public TaskExecutor(
     IApiOperationExecutor apiOperationExecutor,
     IServiceProvider rootServiceProvider)
 {
     this._apiOperationExecutor = apiOperationExecutor;
     this._rootServiceProvider  = rootServiceProvider;
 }
예제 #2
0
 public CounterService(
     IOptionsMonitor <CounterConfiguration> configuration,
     IApiOperationExecutor apiOperationExecutor,
     ILogger <CounterService> logger)
 {
     this.configuration        = configuration;
     this.apiOperationExecutor = apiOperationExecutor;
     this.logger = logger;
 }
예제 #3
0
 public BlueprintApiRouter(
     IApiOperationExecutor apiOperationExecutor,
     IServiceProvider rootServiceProvider,
     ILogger <BlueprintApiRouter> logger,
     IOptions <BlueprintHttpOptions> httpOptions,
     string basePath)
 {
     this._apiOperationExecutor = apiOperationExecutor;
     this._rootServiceProvider  = rootServiceProvider;
     this._logger      = logger;
     this._httpOptions = httpOptions;
     this._basePath    = basePath;
 }
예제 #4
0
        public PlainTextResult Invoke(IApiOperationExecutor executor)
        {
            var codeDidIGenerate = ((CodeGennedExecutor)executor).WhatCodeDidIGenerate()
                                   .Replace("<", "&lt;")
                                   .Replace(">", "&gt;");

            var template = $@"
<!DOCTYPE html>
<html>
<body>
    <style>body {{ margin: 0 }}</style>
	<link href=""https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism-okaidia.css"" rel=""stylesheet"" />
    <pre style=""margin: 0; border-radius: 0;""><code class=""language-csharp"">{codeDidIGenerate}</code></pre>
    <script src=""https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.js""></script>
    <script src=""https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-csharp.js""></script>
</body>
</html>";

            return(new PlainTextResult(template)
            {
                ContentType = "text/html"
            });
        }