private async Task <List <BookModel> > SearchFromBooks(SearchForBookVM model) { var searchBookModel = _mapper.Map <SearchForBookModel>(model); var searchBooks = await _booksLibraryManager.SearchForBooks(searchBookModel); return(searchBooks); }
public async Task <IActionResult> SearchBook(SearchForBookVM model) { _booksCategories = await GetBooksCategories(); model.SearchedResult = await SearchFromBooks(model); model.Categories = _booksCategories.Select(g => new SelectListItem { Text = g.Name, Value = g.CategoryId }).ToList(); return(View(model)); }
public async Task <IActionResult> SearchBook() { _booksCategories = await GetBooksCategories(); var model = new SearchForBookVM { Categories = _booksCategories.Select(g => new SelectListItem { Text = g.Name, Value = g.CategoryId }).ToList() }; return(View(model)); }