public ActionResult ExternalProfiles(int pageIndex = 0, int pageSize = 4) { var profiles = _externalProfilesService.GetExternalProfiles(); var profileListItems = profiles.SelectMany(a => a.Profiles); var pageCount = ((int)profileListItems.Count()) / pageSize; if (profileListItems.Count() % pageSize != 0) { pageCount += 1; } var profileItems = Mapper.Map <IEnumerable <ProfileListItem> >(profileListItems); var viewModel = new ProfileList() { PageCount = pageCount, PageSize = pageSize, PageIndex = pageIndex, Profiles = profileItems.Skip(pageIndex * pageSize).Take(pageSize) }; return(View("Index", viewModel)); }
public ActionResult Status() { var results = _externalProfilesService.GetExternalProfiles(); return(View(results)); }