private void SyncProperty(ApiProperty property) { IProperty propertyEntity = _apiPropertyDataProvider.Read(property.PropertyId); ApiPropertyEntity apiPropertyEntity = new ApiPropertyEntity(property, propertyEntity); _apiPropertyDataProvider.Save(property, apiPropertyEntity); SyncResources(property, propertyEntity, apiPropertyEntity); }
private void SyncResources(ApiProperty property, IProperty propertyEntity, ApiPropertyEntity apiPropertyEntity) { IEnumerable <Resource> resources = property.Images .Union(property.Floorplans) .Union(property.EpcGraphs) .Where(x => ShouldUpdate(x, propertyEntity)); ResourceCollection resourceCollection = new ResourceCollection(resources); DownloadResources(resourceCollection); SaveResources(resourceCollection, apiPropertyEntity); }
public ApiPropertyEntity(ApiProperty apiProperty, IProperty property = null) { _apiProperty = apiProperty ?? throw new ArgumentNullException(nameof(apiProperty)); Automated = true; if (property != null) { PropertyId = property.PropertyId; DevelopmentId = property.DevelopmentId; } }