Beispiel #1
0
        public IActionResult DeleteAvatar()
        {
            // Get user
            var user = _userService.FindByUserName(User.Identity.Name);

            // Load blob info
            _blobService.GetUserImagUrl(user);

            // Delete only if there
            if (user.UserImageUrl != null)
            {
                _blobService.DeleteUserProfilePicture(user.UserName);
                user.UserImageUrl = null;
            }

            return(RedirectToAction("ViewProfile"));
        }