public List <Book> Get() { try { return(_booksProvider.GetBooks()); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); } }
public IHttpActionResult All() { try { var result = _booksProvider.GetBooks(); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void GetBooks() { var books = _booksProvider.GetBooks(); Assert.IsTrue(books != null && books.Count > 0); }
// GET: api/Books public IEnumerable <Book> Get() { return(_booksProvider.GetBooks()); }