DocSas/PropertyService.Domain/ModelView/Users/UserProvider.cs
/// <summary>
/// update user profile images as an asynchronous operation.
/// </summary>
/// <param name="result">The result.</param>
/// <param name="userId">The user identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
update user profile images as an asynchronous operation.
update user profile images as an asynchronous operation .
public async Task<DSCResponse> UpdateUserProfileImagesAsync(StorageResponse result, Guid userId)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            if (result.UploadedResults != null && result.UploadedResults.First().IsSuccess)
            {
                var fileResult = result.UploadedResults.First();
                var userVM = new UserVM() {
                        Id = userId,
                        PhotoOriginal = fileResult.Name,
                        PhotoThumbnail =  fileResult.Name,
                        ChangeType = PSChangeType.UserProfileImage.ToString()
                };
               var saveResponse = await SaveUserAsync(userVM);
               if (saveResponse.IsSuccess)
                {
                    response.ResponseData = saveResponse.ResponseData;
                }
                else
                {
                    msg.Add("SomethingWrong", "Something went wrong");
                }
            }
            return response;
        }
public async Task < DSCResponse > UpdateUserProfileImagesAsync ( StorageResponse result , Guid userId ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; if ( result . UploadedResults != null && result . UploadedResults . First ( ) . IsSuccess ) { var fileResult = result . UploadedResults . First ( ) ; var userVM = new UserVM ( ) { Id = userId , PhotoOriginal = fileResult . Name , PhotoThumbnail = fileResult . Name , ChangeType = PSChangeType . UserProfileImage . ToString ( ) } ; var saveResponse = await SaveUserAsync ( userVM ) ; if ( saveResponse . IsSuccess ) { response . ResponseData = saveResponse . ResponseData ; } else { msg . Add ( " " , " " ) ; } } return response ; }
update user profile images as an asynchronous operation.
update user profile images as an asynchronous operation .
None
result
StorageResponse
None
userId
Guid
The user identifier.
The user identifier .