Exemple #1
0
 public TelecomDeviceRegistration(TelecomDeviceRegistrationData dbRecord) :
     base(dbRecord)
 {
     Data.Address = Data.Address ?? new GeographicAddressData();
     Data.Device  = Data.Device ?? new TelecomAddressData();
     Address      = AddressFactory.Create(Data.Address) as GeographicAddress;
     Device       = AddressFactory.Create(Data.Device) as TelecomAddress;
 }
        public static TelecomDeviceRegistration Create(GeographicAddress address,
                                                       TelecomAddress device,
                                                       DateTime?validFrom = null, DateTime?validTo = null)
        {
            var o = new TelecomDeviceRegistrationData {
                Address   = address?.Data ?? new GeographicAddressData(),
                Device    = device?.Data ?? new TelecomAddressData(),
                ValidFrom = validFrom ?? DateTime.MinValue,
                ValidTo   = validTo ?? DateTime.MaxValue
            };

            o.AddressID = o.Address?.ID;
            o.DeviceID  = o.Device?.ID;
            return(new TelecomDeviceRegistration(o));
        }
 public void RegisteredInAddress(GeographicAddress geographicAddress)
 {
     if (geographicAddress is null)
     {
         return;
     }
     if (geographicAddress.Data.ID == Constants.Unspecified)
     {
         return;
     }
     if (registeredInAddresses.Find(x => x.Data.ID == geographicAddress.Data.ID) != null)
     {
         return;
     }
     registeredInAddresses.Add(geographicAddress);
 }