public ActionResult Create(UploadBookViewModel model) { try { // TODO: Add insert logic here if (ModelState.IsValid) { model.OwnerId = this.User.FindFirstValue(ClaimTypes.NameIdentifier); var msg = bookService.UploadBook(model); if (msg == ServiceResultMsg.BOOK_UPLOAD_SUCCESS) { HomePageTransferData m = new HomePageTransferData() { BookServiceMsg = msg }; return(RedirectToAction("Index", "Home")); } } return(RedirectToAction("Index")); } catch (Exception e) { return(View()); } }
public IActionResult Index() { var data = new HomePageTransferData(); data.TopBooks = this.bookService.GetMostPopularBooks(NumberBooks); //data.SuggestedBooks = this.bookSuggestionService.GetSuggestionBook(this.User); return(View(data)); }