public ActionResult <string> Get() { StringWriter sw = new StringWriter(); _graphWriter.Write(_compositeEndpointDataSource, sw); return(sw.ToString()); }
public IActionResult Graph() { var sw = new StringWriter(); _graphWriter.Write(_endpointDataSource, sw); return(Content(sw.ToString())); }
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()); }); }
public IActionResult GetRoutes() { using (var sw = new StringWriter()) { _graphWriter.Write(_endpointData, sw); var graph = sw.ToString(); return(Content(graph, "text/plain")); } }
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()); }); }
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); } }