예제 #1
0
        /// <summary>
        /// Redirects to the profile picture of the user with the specified ID. If it doesn't exist,
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public async Task <RedirectResult> GetUserProfile(string userId)
        {
            if (string.IsNullOrWhiteSpace(userId))
            {
                return(Redirect(DefaultProfilePic.ToString()));
            }

            var user = await DbSession.LoadOptionalAsync <AppUser>(userId);

            var profilePic = user?.ProfilePicUrl ?? DefaultProfilePic;

            return(Redirect(profilePic.ToString()));
        }