示例#1
0
        public async Task <IActionResult> GetContentById
        (
            [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req,
            ILogger log
        )
        {
            string Id = req.Query["Id"];

            if (!int.TryParse(Id, out _))
            {
                return(new BadRequestObjectResult("Id is required and must be an Integer"));
            }

            log.LogInformation("C# HTTP GetHealthScore trigger function processed a request.");

            var details = await _manager.GetByIdAsync(int.Parse(Id));

            return(new OkObjectResult(details));
        }