Esempio n. 1
0
        public async Task <JsonResult> DeleteProfilePicture()
        {
            if (SiteUser == null)
            {
                return(ApiResult(false));
            }
            await _fileRepository.DeleteAsync(SiteUser.ProfilePicUrl);

            var result = await _securityRepository.DeleteUserPictureUrl(SiteUser.UserId);

            if (result)
            {
                RefreshProfilePicture(string.Empty);
            }

            return(Json(new { success = result, imageUrl = "/Static/images/user-avatar__default.jpg" }, JsonRequestBehavior.AllowGet));
        }