public async Task <IActionResult> AddBook([FromBody] BookDto bookDto) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await _repo.AddBook(bookDto); Response <int> response = new Response <int> { Result = result }; if (result == 1) { return(Ok("Book Added")); } if (result == 2) { return(Ok("Book Already Exits")); } return(BadRequest("Error while adding book")); }