public ActionResult ReturnBook([FromBody] ReturnBook returnBook)
        {
            try
            {
                var isBookReturn = _returnBookService.BookReturn(returnBook.StudentId, returnBook.BookBarCode);

                if (isBookReturn)
                {
                    return(Ok("Book Successfully Returned"));
                }
                else
                {
                    return(NotFound("Return Book Failed"));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Ejemplo n.º 2
0
 public void ReturnBook([FromBody] ReturnBook returnBook)
 {
     _returnBookService.BookReturn(returnBook.StudentId, returnBook.BookBarCode);
 }