Exemplo n.º 1
0
        public static async Task <HttpResponseMessage> GetAsync(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "httpmonitors")] HttpRequestMessage req,
            TraceWriter log,
            [Inject] IHttpMonitorService service,
            [Inject] JsonMediaTypeFormatter formatter)
        {
            var httpMonitors = await service.GetHttpMonitorsAsync();

            return(req.CreateResponse(HttpStatusCode.OK, httpMonitors, formatter));
        }
        public async Task <IActionResult> Get()
        {
            var httpMonitors = await _service.GetHttpMonitorsAsync();

            return(Ok(httpMonitors));
        }