public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "getlibrarybookstatus")] HttpRequest req, ILogger log)
        {
            var result = _tokenProvider.ValidateToken(req);

            if (result.Status == AccessTokenStatus.Valid)
            {
                log.LogInformation($"Request received for {result.Principal.Identity.Name}.");
            }
            else
            {
                return(new UnauthorizedResult());
            }

            string Id = req.Query["Id"];

            string  requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            dynamic data        = JsonConvert.DeserializeObject(requestBody);

            Id = Id ?? data?.name;

            if (string.IsNullOrEmpty(Id))
            {
                return(new BadRequestObjectResult("Please pass id on the query string or in the request body"));
            }

            var librarybookstatus = _libraryBookStatusWebApiManager.GetLibraryBookStatusByLibraryBookStatusCode(Id);

            if (librarybookstatus == null)
            {
                return(new BadRequestObjectResult("Book not found"));
            }

            return((ActionResult) new OkObjectResult(librarybookstatus));
        }
        public IActionResult Get(string id)
        {
            var librarbookstatus = _libraryBookStatusWebApiManager.GetLibraryBookStatusByLibraryBookStatusCode(id);

            if (librarbookstatus == null)
            {
                ModelState.AddModelError(string.Empty, "Unknown code");
                return(BadRequest(ModelState));
            }

            return(Ok(librarbookstatus));
        }