private static void ExtractRentalNewConstruction(XElement document, RentalListing listing) { document.ShouldNotBe(null); listing.ShouldNotBe(null); if (!document.BoolValueOrDefault("newConstruction")) { return; } if (listing.Features == null) { listing.Features = new Features(); } if (listing.Features.Tags == null) { listing.Features.Tags = new HashSet<string>(); } listing.Features.Tags.Add("isANewConstruction"); }
private static void ExtractRentalData(RentalListing rentalListing, XElement document, CultureInfo cultureInfo) { rentalListing.ShouldNotBe(null); document.ShouldNotBe(null); var dateAvailble = document.ValueOrDefault("dateAvailable"); if (!string.IsNullOrWhiteSpace(dateAvailble)) { rentalListing.AvailableOn = ToDateTime(dateAvailble); } rentalListing.PropertyType = ExtractResidentialAndRentalPropertyType(document); rentalListing.Pricing = ExtractRentalPricing(document, cultureInfo); rentalListing.Features = ExtractFeatures(document); rentalListing.BuildingDetails = ExtractBuildingDetails(document); ExtractRentalNewConstruction(document, rentalListing); }