コード例 #1
0
 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
     };
 }
コード例 #2
0
 public override void AddArea(HousingContext.Property property)
 {
     if (!RandomHelper.GenerateAOneInXChance(200))
     {
         return;
     }
     BuiltAddress.Area = Faker.Address.StreetName();
 }
コード例 #3
0
 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}" : "";
 }
コード例 #4
0
 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);
 }
コード例 #5
0
        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}" : "";
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public override void AddArea(HousingContext.Property property)
 {
     BuiltAddress.Area = IsChance(Random.Next(1, 20), 20) ? Faker.Address.StreetName() : null;
 }
コード例 #9
0
 public override void AddCity(HousingContext.Property property)
 {
     BuiltAddress.City = Faker.Address.City();
 }
コード例 #10
0
 public abstract void AddComposite(HousingContext.Property property);
コード例 #11
0
 public override void AddStreet(HousingContext.Property property)
 {
     BuiltAddress.Street = Faker.Address.StreetName();
 }
コード例 #12
0
 public abstract void AddCity(HousingContext.Property property);
コード例 #13
0
 public abstract void AddPostCode(HousingContext.Property property);
コード例 #14
0
 public abstract void AddStreet(HousingContext.Property property);
コード例 #15
0
 public abstract void AddArea(HousingContext.Property property);
コード例 #16
0
 public override void AddPostCode(HousingContext.Property property)
 {
     BuiltAddress.PostCode = Faker.Address.UkPostCode();
 }
コード例 #17
0
 public void SetParent(HousingContext.Property property)
 {
     BuiltProperty.ParentId = property;
 }
コード例 #18
0
 public abstract void SetProperty(HousingContext.Property property);
コード例 #19
0
 public override void SetProperty(HousingContext.Property property)
 {
     BuiltTenancy.PropertyId = property;
 }
コード例 #20
0
 public override void AddComposite(HousingContext.Property property)
 {
     base.AddComposite(property);
     BuiltAddress.Composite = $"{BuiltAddress.FlatNumber} {BuiltAddress.Composite}";
 }
コード例 #21
0
        public override void AddStreet(HousingContext.Property property)
        {
            var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId;

            BuiltAddress.Street = estateAddress.Street;
        }
コード例 #22
0
        public override void AddPostCode(HousingContext.Property property)
        {
            var estateAddress = AssociatedAddressList.First(x => x.PropertyId == property.ParentId).AddressId;

            BuiltAddress.PostCode = estateAddress.PostCode;
        }