示例#1
0
        }                                           //DE-BW, DE-BY

        public TAddress Clone()
        {
            var result = new TAddress();

            result.Update(this);
            return(result);
        }
示例#2
0
        public static TAddress CreateRandom()
        {
            var hasAdressGeneral = rnd.Next(100) < 10;
            var hasPoBox         = rnd.Next(100) < 5;
            var hasTownSection   = rnd.Next(100) < 10;

            var adresse = new TAddress
            {
                streetName    = streets[rnd.Next(streets.Length - 1)],
                town          = towns[rnd.Next(towns.Length - 1)],
                postalCode    = (10000 + rnd.Next(88888)).ToString(),
                countryIso2   = "DE",
                streetNumber  = (rnd.Next(99) + 1).ToString(),
                adressGeneral = hasAdressGeneral ? (rnd.Next(9) + 1).ToString() + ".Etage" : "",
                stateIso      = states[rnd.Next(3)],
                poBox         = hasPoBox ? "PF " + (rnd.Next(99) + 1).ToString() + " " + (rnd.Next(99) + 1).ToString() : "",
                townSection   = hasTownSection ? townSections[rnd.Next(townSections.Length - 1)] : ""
            };

            return(adresse);
        }