public void Init(List <HousingContext.Property> properties) { BuiltProperty = new HousingContext.Property() { Id = properties.Count < 1 ? IdSeed : (from p in properties select p.Id).Max() + 1 }; }
public override void AddArea(HousingContext.Property property) { if (!RandomHelper.GenerateAOneInXChance(200)) { return; } BuiltAddress.Area = Faker.Address.StreetName(); }
public override void AddComposite(HousingContext.Property property) { BuiltAddress.Composite = !string.IsNullOrEmpty(BuiltAddress.Street) ? $"{BuiltAddress.StreetNumber} {BuiltAddress.Street}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(BuiltAddress.Area) ? $"\n{BuiltAddress.Area}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(BuiltAddress.City) ? $"\n{BuiltAddress.City}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(BuiltAddress.County) ? $"\n{BuiltAddress.County}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(BuiltAddress.PostCode) ? $"\n{BuiltAddress.PostCode}" : ""; }
public HousingContext.Tenancy Build( ITenancyBuilder builder, List <HousingContext.Tenancy> tenancies, List <TenancyType> tenancyTypes, List <TenureType> tenureTypes, HousingContext.Property property) { builder.Init(tenancies); builder.SetName(); builder.SetStartDate(); builder.SetEndDate(); builder.SetTenancyType(tenancyTypes); builder.SetTenureType(tenureTypes); builder.SetProperty(property); return(builder.Tenancy); }
public override void AddComposite(HousingContext.Property property) { var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId; BuiltAddress.Composite = $"{BuiltAddress.BuildingName}"; BuiltAddress.Composite += !string.IsNullOrEmpty(estateAddress.Street) ? $"\n{estateAddress.StreetNumber} {estateAddress.Street}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(estateAddress.Area) ? $"\n{estateAddress.Area}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(estateAddress.City) ? $"\n{estateAddress.City}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(estateAddress.County) ? $"\n{estateAddress.County}" : ""; BuiltAddress.Composite += !string.IsNullOrEmpty(estateAddress.PostCode) ? $"\n{estateAddress.PostCode}" : ""; }
public HousingContext.Address Build( IAddressBuilder builder, HousingContext.Property property, List <HousingContext.Address> addresses) { builder.Init(addresses); builder.AddBuildingName(); builder.AddStreetNumber(); builder.AddStreet(property); builder.AddFlatNumber(); builder.AddArea(property); builder.AddCity(property); builder.AddPostCode(property); builder.AddCity(property); builder.AddComposite(property); return(builder.Address); }
public HousingContext.Property Build( IPropertyBuilder builder, List <HousingContext.Property> properties, List <PropertyType> propertyTypes, List <PropertySubType> propertySubTypes, List <LeaseType> leaseTypes, List <HousingContext.Address> addresses, List <AssociatedAddress> associatedAddresses, List <AddressType> addressTypes, HousingContext.Property parent) { builder.Init(properties); builder.SetParent(parent); builder.SetPropertyType(propertyTypes); builder.SetPropertySubType(propertySubTypes); builder.SetLeaseType(leaseTypes); builder.SetName(); builder.SetPostalAddress(addresses, associatedAddresses, addressTypes); return(builder.Property); }
public override void AddArea(HousingContext.Property property) { BuiltAddress.Area = IsChance(Random.Next(1, 20), 20) ? Faker.Address.StreetName() : null; }
public override void AddCity(HousingContext.Property property) { BuiltAddress.City = Faker.Address.City(); }
public abstract void AddComposite(HousingContext.Property property);
public override void AddStreet(HousingContext.Property property) { BuiltAddress.Street = Faker.Address.StreetName(); }
public abstract void AddCity(HousingContext.Property property);
public abstract void AddPostCode(HousingContext.Property property);
public abstract void AddStreet(HousingContext.Property property);
public abstract void AddArea(HousingContext.Property property);
public override void AddPostCode(HousingContext.Property property) { BuiltAddress.PostCode = Faker.Address.UkPostCode(); }
public void SetParent(HousingContext.Property property) { BuiltProperty.ParentId = property; }
public abstract void SetProperty(HousingContext.Property property);
public override void SetProperty(HousingContext.Property property) { BuiltTenancy.PropertyId = property; }
public override void AddComposite(HousingContext.Property property) { base.AddComposite(property); BuiltAddress.Composite = $"{BuiltAddress.FlatNumber} {BuiltAddress.Composite}"; }
public override void AddStreet(HousingContext.Property property) { var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId; BuiltAddress.Street = estateAddress.Street; }
public override void AddPostCode(HousingContext.Property property) { var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId; BuiltAddress.PostCode = estateAddress.PostCode; }