public Task <int> EditPropertyAsync(int agencyId, EditPropertyRequestDto model) { return(HandleAsync(async() => { var client = GetPropertyClient(); var request = Mapping.Mapper.Map <EditPropertyRequest>(model, opt => opt.AfterMap((src, dest) => dest.AgencyId = agencyId)); var response = await client.EditPropertyAsync(request); return response.Id; })); }
public async Task <int> EditAsync(int agencyId, EditPropertyRequestDto request) { var newAttacments = new List <PropertyAttachmentDto>(); foreach (var file in request.AttachmentsToAdd) { var url = await UploadFileAsync(file); newAttacments.Add(new PropertyAttachmentDto { Name = file.Name, Url = url, }); } request.Attachments = request.Attachments.Concat(newAttacments); return(await _client.EditPropertyAsync(agencyId, request)); }