Esempio n. 1
0
        public IActionResult Index()
        {
            var profiles = this.usersService.GetAll()
                           .OrderByDescending(user => user.Rating)
                           .Select(u => new ProfileViewModel
            {
                Email           = u.Email,
                ProfileImageUrl = u.ProfileImageUrl,
                UserRating      = u.Rating.ToString(),
                DateJoined      = u.CreatedOn,
                IsActive        = u.IsActive,
            });

            var model = new ProfileListingViewModel
            {
                Profiles = profiles,
            };

            return(this.View(model));
        }
Esempio n. 2
0
        public IActionResult Index()
        {
            var profile = _userService.GetAll()
                          .OrderByDescending(user => user.Rating)
                          .Select(u => new ProfileViewModel
            {
                UserId          = u.Id,
                UserName        = u.UserName,
                ProfileImageUrl = u.ProfileImageUrl,
                Email           = u.Email,
                UserRating      = u.Rating.ToString(),
                MemberSince     = u.MemberSince,
            });

            var model = new ProfileListingViewModel
            {
                Profiles = profile
            };

            return(View(model));
        }