コード例 #1
0
        public ActionResult <string> Get()
        {
            StringWriter sw = new StringWriter();

            _graphWriter.Write(_compositeEndpointDataSource, sw);

            return(sw.ToString());
        }
コード例 #2
0
        public IActionResult Graph()
        {
            var sw = new StringWriter();

            _graphWriter.Write(_endpointDataSource, sw);

            return(Content(sw.ToString()));
        }
コード例 #3
0
 public GraphModule(DfaGraphWriter graphWriter, EndpointDataSource endpointDataSource)
 {
     this.Get("/graph", async context =>
     {
         var sw = new StringWriter();
         graphWriter.Write(endpointDataSource, sw);
         await context.Response.WriteAsync(sw.ToString());
     });
 }
コード例 #4
0
 public IActionResult GetRoutes()
 {
     using (var sw = new StringWriter())
     {
         _graphWriter.Write(_endpointData, sw);
         var graph = sw.ToString();
         return(Content(graph, "text/plain"));
     }
 }
コード例 #5
0
 public GraphModule(DfaGraphWriter graphWriter, EndpointDataSource endpointDataSource)
 {
     this.Get("/graph", async context =>
     {
         //Write out a graphvz format of the app's routing and view here https://dreampuf.github.io/GraphvizOnline
         var sw = new StringWriter();
         graphWriter.Write(endpointDataSource, sw);
         await context.Response.WriteAsync(sw.ToString());
     });
 }
コード例 #6
0
        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
        {
            context.Response.StatusCode  = 200;
            context.Response.ContentType = "text/plain";

            await using (var sw = new StringWriter())
            {
                graphWriter.Write(endpointData, sw);
                var data = sw.ToString();
                await context.Response.WriteAsync(data);
            }
        }
        public async Task Invoke(HttpContext context)
        {
            // set the response
            context.Response.StatusCode  = 200;
            context.Response.ContentType = "text/plain";

            // Write the response into memory
            await using (var sw = new StringWriter())
            {
                // Write the graph
                _graphWriter.Write(_endpointData, sw);
                var graph = sw.ToString();

                // Write the graph to the response
                await context.Response.WriteAsync(graph);
            }
        }