public ActionResult Index() { var profiles = _userRepositories.GetAll() .OrderByDescending(user => user.Rating) .Select(u => new ProfileModel { Email = u.Email, UserName = u.UserName, UserRating = u.Rating.ToString(), MemberSince = u.MemberSince, }); var model = new ProfileListingModel { Profiles = profiles }; return(View(model)); }
public IActionResult Index() { var profiles = _userService.GetAll().OrderByDescending(u => u.Rating) .Select(user => new ProfileModel { Email = user.Email, Username = user.UserName, ProfileImageUrl = user.ProfileImageUrl, UserRating = user.Rating, MemberSince = user.MemberSince }); var model = new ProfileListingModel { Profiles = profiles }; return(View(model)); }