예제 #1
0
        public IActionResult UpdateAvatar(IFormFile file)
        {
            var claimsIdentity = User.Identity as ClaimsIdentity;
            var userid         = Convert.ToInt32(claimsIdentity.FindFirst(ClaimTypes.Name)?.Value);
            var man            = _usersRepository.GetUserByID(userid);

            var    upload = new UploadImages(_environment);
            string avatar = upload.Upload(file);

            man.Avatar = avatar;
            _usersRepository.ModifyUser(man);
            return(Ok());
        }