public async Task <IActionResult> ViewBookDetails(int id) { BookWebServiceClient bookWebServiceClient = new BookWebServiceClient(); retrieveBookResponse response = await bookWebServiceClient.retrieveBookAsync(id); retrieveBookRsp rsp = response.@return; Demo03ViewModel demo03ViewModel = new Demo03ViewModel(); demo03ViewModel.SelectedBookToView = rsp.book; return(View(demo03ViewModel)); }
public async Task <IActionResult> ViewAllBooks() { BookWebServiceClient bookWebServiceClient = new BookWebServiceClient(); retrieveAllBooksResponse response = await bookWebServiceClient.retrieveAllBooksAsync(); retrieveAllBooksRsp rsp = response.@return; Demo03ViewModel demo03ViewModel = new Demo03ViewModel(); demo03ViewModel.Books = rsp.books; return(View(demo03ViewModel)); }