コード例 #1
0
ファイル: ProfilesController.cs プロジェクト: grpiccoli/BM
        public IActionResult Details(string id)
        {
            var user      = _userService.GetById(id);
            var userRoles = _userManager.GetRolesAsync(user).Result;

            var model = new ProfileModel()
            {
                UserId          = user.Id,
                UserName        = user.UserName,
                UserRating      = user.Rating,
                Email           = user.Email,
                ProfileImageUrl = user.ProfileImageUrl,
                MemberSince     = user.MemberSince,
                IsAdmin         = userRoles.Contains("Administrador")
            };

            return(View(model));
        }