DocSas/PropertyService.Domain/ModelView/property/PropertyProvider.cs
/// <summary>
/// update property images as an asynchronous operation.
/// </summary>
/// <param name="result">The result.</param>
/// <param name="propertyInfoId">The property information identifier.</param>
/// <param name="userId">The user identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
update property images as an asynchronous operation.
update property images as an asynchronous operation .
public async Task<DSCResponse> UpdatePropertyImagesAsync(StorageResponse result, Guid propertyInfoId, Guid userId)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            if (result.UploadedResults != null && result.UploadedResults.First().IsSuccess)
            {
                var propResponse = await GetPropertyAsync(propertyInfoId);
                if (propResponse.ResponseData != null)
                {
                    var prop = propResponse.ResponseData as PropertyInformationVM;
                    if (prop != null)
                    {
                        var fileResult = result.UploadedResults.First();
                        prop.CoverOriginal = fileResult.Name;
                        prop.CoverThumbnail = fileResult.Name;
                        prop.UserId = userId;
                        var saveResponse = await SavePropertyInfoAsync(prop);
                        if (saveResponse.IsSuccess)
                        {
                            response.ResponseData = saveResponse.ResponseData;
                        }
                    }
                }
            }
            return response;
        }
public async Task < DSCResponse > UpdatePropertyImagesAsync ( StorageResponse result , Guid propertyInfoId , Guid userId ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; if ( result . UploadedResults != null && result . UploadedResults . First ( ) . IsSuccess ) { var propResponse = await GetPropertyAsync ( propertyInfoId ) ; if ( propResponse . ResponseData != null ) { var prop = propResponse . ResponseData as PropertyInformationVM ; if ( prop != null ) { var fileResult = result . UploadedResults . First ( ) ; prop . CoverOriginal = fileResult . Name ; prop . CoverThumbnail = fileResult . Name ; prop . UserId = userId ; var saveResponse = await SavePropertyInfoAsync ( prop ) ; if ( saveResponse . IsSuccess ) { response . ResponseData = saveResponse . ResponseData ; } } } } return response ; }
update property images as an asynchronous operation.
update property images as an asynchronous operation .
None
result
StorageResponse
None
propertyInfoId
Guid
The property information identifier.
The property information identifier .
userId
Guid
The user identifier.
The user identifier .