예제 #1
0
 public async Task <IActionResult <bool> > UpdateAvailabilityStatus(
     [HttpTrigger(AuthorizationLevel.Anonymous, "options", Route = HttpRoutes.SetBookAvailabilityStatus)] BookAvailabilityStatusUpdateModel input,
     HttpRequest req,
     ILogger log,
     ExecutionContext context,
     int bookIDParam)
 {
     return(new OkObjectResult <bool>(req, true));
 }
예제 #2
0
        public async Task <IActionResult <bool> > UpdateAvailabilityStatus(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = HttpRoutes.SetBookAvailabilityStatus)] BookAvailabilityStatusUpdateModel input,
            HttpRequest req,
            ILogger log,
            ExecutionContext context,
            int bookIDParam)
        {
            if (!TryValidateBookId <bool>(bookIDParam, input, req, out var result))
            {
                return(result);
            }

            log.LogInformation($"UpdateAvailabilityStatus: {input.Status} ({input.StatusRemark}) with id {input.BookID}");
            bookLogic.UpdateAvailability(input.BookID.Value, input.Status, input.StatusRemark);

            return(new OkObjectResult <bool>(req, true));
        }