public int CountingBooks() { var store = new BookStore(); int countOf = store.GetCount(); return(countOf); }
public IActionResult Delete(int id) { var store = new BookStore(); store.RemoveBook(id); return(Ok()); }
public IActionResult Put(int id, [FromBody] Book edited) { edited.id = (int)id; Console.WriteLine("Updating book: {0}...", edited.title); var store = new BookStore(); return(new ObjectResult(store.EditedBook(edited))); }
public IActionResult AddABook([FromBody] Book newBook) { Console.WriteLine("Inserting book: {0}..."); var store = new BookStore(); Book bookObj = store.AddABook(newBook); if (null != bookObj) { return(new ObjectResult(bookObj)); } else { return(new ObjectResult(new Book())); } }
public IActionResult RetrieveBooks([FromBody] SortedBooks sortObj) { var bookcase = new BookStore().GetBooks(sortObj); return(new ObjectResult(bookcase)); }
public IActionResult SearchBooks(string thing) { var found = new BookStore().SearchBooks(thing); return(new ObjectResult(found)); }
public IActionResult RetrieveBooks() { var bookcase = new BookStore().GetBooks(); return(new ObjectResult(bookcase)); }