public async Task <IActionResult> OnGet(string bookId) { var spec = new BookByIdWithMembersSpec(int.Parse(bookId)); var book = await _bookRepository.GetBySpecAsync(spec); if (book == null) { return(NotFound(bookId)); } BookDetailsViewModel = new BookDetailsViewModel(book !); return(Page()); }
public async Task OnGet(string bookId) { // I don't think we need this - SAS //var user = await _userManager.FindByIdAsync(id); //if (user == null) //{ // BadRequest(); //} var spec = new BookByIdWithMembersSpec(int.Parse(bookId)); var book = await _repository.GetAsync(spec); if (book == null) { // TODO: Add logging BadRequest(); } BookDetailsViewModel = new BookDetailsViewModel(book !); }