public IActionResult AdvancedSearch(BooksAdvancedSearch viewModel) { viewModel.Title = String.IsNullOrEmpty(viewModel.Title) ? "" : viewModel.Title; viewModel.ISBN = String.IsNullOrEmpty(viewModel.ISBN) ? "" : viewModel.ISBN; viewModel.Publisher = String.IsNullOrEmpty(viewModel.Publisher) ? "" : viewModel.Publisher; viewModel.Author = String.IsNullOrEmpty(viewModel.Author) ? "" : viewModel.Author; viewModel.Translator = String.IsNullOrEmpty(viewModel.Translator) ? "" : viewModel.Translator; viewModel.Category = String.IsNullOrEmpty(viewModel.Category) ? "" : viewModel.Category; viewModel.Language = String.IsNullOrEmpty(viewModel.Language) ? "" : viewModel.Language; var books = uw.BookRepository.GetAllBooks(viewModel.Title, viewModel.ISBN, viewModel.Language, viewModel.Publisher, viewModel.Author, viewModel.Translator, viewModel.Category); return(View(books)); }
public IActionResult AdvancedSearch(BooksAdvancedSearch ViewModel) { ViewModel.Title = String.IsNullOrEmpty(ViewModel.Title) ? "" : ViewModel.Title; ViewModel.ISBN = String.IsNullOrEmpty(ViewModel.ISBN) ? "" : ViewModel.ISBN; ViewModel.Publisher = String.IsNullOrEmpty(ViewModel.Publisher) ? "" : ViewModel.Publisher; ViewModel.Author = String.IsNullOrEmpty(ViewModel.Author) ? "" : ViewModel.Author; ViewModel.Translator = String.IsNullOrEmpty(ViewModel.Translator) ? "" : ViewModel.Translator; ViewModel.Category = String.IsNullOrEmpty(ViewModel.Category) ? "" : ViewModel.Category; ViewModel.Language = String.IsNullOrEmpty(ViewModel.Language) ? "" : ViewModel.Language; var Books = _UW.BooksRepository.GetAllBooks(ViewModel.Title, ViewModel.ISBN, ViewModel.Language, ViewModel.Publisher, ViewModel.Author, ViewModel.Translator, ViewModel.Category); return(View(Books)); }