public IActionResult AddBookReview(AddBookReviewCommand newReview) { var repo = new BookReviewRepository(); var bookReviewAdded = repo.AddBookReview(newReview); if (bookReviewAdded != null) { return(Ok(newReview)); } return(BadRequest($"Unable to add review.")); }
public IActionResult GetUserReviewForBook(int UserId, int BookId) { var repo = new BookReviewRepository(); var retrievedBookReview = repo.GetUserReviewForBook(UserId, BookId); if (retrievedBookReview != null) { return(Ok(repo.GetUserReviewForBook(UserId, BookId))); } return(NoContent()); }
public BookReviewController(IRepository <BookReview> repository, BookReviewRepository bookReviewRepository) { _irepo = repository; _repo = bookReviewRepository; }
public IEnumerable <BookReviewDTO> GetAllReviewsByUser(int UserId) { var repo = new BookReviewRepository(); return(repo.GetAllReviewsByUser(UserId)); }
public IEnumerable <BookReviewDTO> GetAllReviewsByBook(int goodReadsBookId) { var repo = new BookReviewRepository(); return(repo.GetAllReviewsByBook(goodReadsBookId)); }