public async Task <DirectorListViewModel> GetAllDirectorsList() { var directors = await _directorRepository.GetAllAsync(); var viewModel = new DirectorListViewModel { Directors = directors }; return(viewModel); }
public ActionResult Index(int?page, string searchString = null) { ViewBag.DirectorFilter = searchString; var directors = _directorDataProvider.GetDirectorBySearchString(searchString, ApplicationUser); var pageSize = 5; var pageNumber = (page ?? 1); var actorsListViewModel = new DirectorListViewModel() { DirectorsList = directors.ToPagedList(pageNumber, pageSize) }; return(View(actorsListViewModel)); }