public async Task Invoke(HttpContext context) { try { var routeInfo = RouteHelper.GetAllRoutes(_actionDescriptorCollectionProvider); await context.Response.WriteAsync(JsonConvert.SerializeObject(routeInfo)); return; } catch (Exception e) { await context.Response.WriteAsync($"{e.Message}"); return; } }
public async Task Invoke(HttpContext context) { try { var routeInfo = RouteHelper.GetAllRoutes(_actionDescriptorCollectionProvider); await context.Response.WriteAsync(JsonSerializer.Serialize(routeInfo, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, })); return; } catch (Exception e) { await context.Response.WriteAsync($"{e.Message}"); return; } }