public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,
            [Inject] IBooksDataAgent bookDataAgent,
            ILogger log)
        {
            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            Books  book        = JsonConvert.DeserializeObject <Books>(requestBody);

            string query = $"INSERT INTO BOOK (NMBOOK, IDAUTHOR, IDPUBLISHER, ISBN) VALUES('{book.Nmbook}', {book.Idauthor}, {book.Idpublisher}, '{book.Isbn}')";

            bookDataAgent.ManipulationQuery(query);
            return(new OkObjectResult(book));
        }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "put", Route = null)] HttpRequest req,
            [Inject] IBooksDataAgent bookDataAgent,
            ILogger log)
        {
            string idBook = req.Query["isbn"];

            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            Books  book        = JsonConvert.DeserializeObject <Books>(requestBody);

            string query = $"UPDATE BOOK SET NMBOOK = '{book.Nmbook}', IDAUTHOR = {book.Idauthor}, IDPUBLISHER = {book.Idpublisher} WHERE ISBN = '{idBook}'";

            bookDataAgent.ManipulationQuery(query);
            return(new OkObjectResult(book));
        }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = null)] HttpRequest req,
            [Inject] IBooksDataAgent bookDataAgent,
            ILogger log)
        {
            string idBook = req.Query["isbn"];

            string query = $"DELETE FROM BOOK WHERE ISBN = {idBook}";

            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            Books  book        = JsonConvert.DeserializeObject <Books>(requestBody);

            bookDataAgent.ManipulationQuery(query);
            return(new OkObjectResult(book));
        }