Esempio n. 1
0
        public UserThumbnail Thumbnail()
        {
            Claim idClaim = User.FindFirst(ClaimTypes.NameIdentifier);

            if (idClaim == null)
            {
                return(new UserThumbnail("/user-images/anonymous.png", "Anonymous"));
            }

            string id       = idClaim.Value;
            string username = User.FindFirst(ClaimTypes.Name).Value;

            string userImageFilename = _userImageService.UserImageFilenameForUserId(id);

            return(new UserThumbnail($"/user-images/{userImageFilename}", username));
        }