Exemple #1
0
        public static async Task <IActionResult> ReadRange(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation($"{nameof(ReadRange)}({Expand(req.Query)})");

            string doc   = req.Query["doc"];
            string range = req.Query["range"];

            using var service = new GoogleService(doc);

            try
            {
                var result = await service.ReadRange(range).ConfigureAwait(false);

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                log.LogInformation(ex.ToString());
                return(new BadRequestObjectResult(ex.ToString()));
            }
        }