Exemple #1
0
        //DELETE: api/Books/5
        public async Task <HttpResponseMessage> Delete([FromBody] ISBNNumber isbnDetails)
        {
            try
            {
                var result = await booksRepository.DeleteBookDetails(isbnDetails);

                if (result)
                {
                    return(new HttpResponseMessage()
                    {
                        StatusCode = HttpStatusCode.OK
                    });
                }
                return(new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.BadRequest
                });
            }
            catch (Exception ex)
            {
                loggers.LogError(ex);
                return(new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(JsonConvert.SerializeObject(ex.Message))
                });
            }
        }