Beispiel #1
0
        public static GeographicAddress Create(GeographicAddressView v)
        {
            var d = new GeographicAddressData {
                ID                         = v.ID,
                Address                    = v.AddressLine,
                CityOrAreaCode             = v.City,
                ZipOrPostCodeOrExtension   = v.ZipOrPostalCode,
                RegionOrStateOrCountryCode = v.RegionOrState,
                CountryID                  = v.Country,
                ValidTo                    = v.ValidTo ?? DateTime.MaxValue,
                ValidFrom                  = v.ValidFrom ?? DateTime.MinValue
            };

            return(new GeographicAddress(d));
        }
Beispiel #2
0
        private static GeographicAddressView create(GeographicAddress o)
        {
            var v = new GeographicAddressView {
                AddressLine     = o?.Data?.Address,
                City            = o?.Data?.CityOrAreaCode,
                ZipOrPostalCode = o?.Data?.ZipOrPostCodeOrExtension,
                RegionOrState   = o?.Data?.RegionOrStateOrCountryCode,
                Country         = o?.Data?.CountryID
            };

            setCommonValues(v, o?.Data?.ID, o?.Data?.ValidFrom, o?.Data?.ValidTo);
            if (o is null)
            {
                return(v);
            }
            foreach (var c in o.RegisteredTelecomDevices)
            {
                var device = create(c);
                v.RegisteredTelecomAddresses.Add(device);
            }

            return(v);
        }