Beispiel #1
0
        public static async Task <User> UpdatePersonalDTOToUser(UpdatePersonalDTO personalDTO, User user)
        {
            user.FirstName = personalDTO.FirstName;
            user.LastName  = personalDTO.LastName;

            if (personalDTO.ProfilePicture != null)
            {
                user.ProfilePicture = await FileToByteArray.ImageToByteArray(personalDTO.ProfilePicture);
            }

            return(user);
        }
        public async Task <List <string> > UpdatePersonalInfoAsync(UpdatePersonalDTO personalDTO, ClaimsPrincipal sessionUser)
        {
            var targetUser = await GetUserByClaimCheckNullAsync(sessionUser);

            targetUser = await DTOToModel.UpdatePersonalDTOToUser(personalDTO, targetUser);

            var response = await _userManager.UpdateAsync(targetUser);

            var errorList = new List <string>();

            if (response.Succeeded)
            {
                return(errorList);
            }

            return(ResponseErrors(response, errorList));
        }