Exemple #1
0
 public DeviceServiceModel(Device azureDevice, DeviceTwinServiceModel twin, string ioTHubHostName) :
     this(
         etag : azureDevice.ETag,
         id : azureDevice.Id,
         c2DMessageCount : azureDevice.CloudToDeviceMessageCount,
         lastActivity : azureDevice.LastActivityTime,
         connected : azureDevice.ConnectionState.Equals(DeviceConnectionState.Connected),
         enabled : azureDevice.Status.Equals(DeviceStatus.Enabled),
         lastStatusUpdated : azureDevice.StatusUpdatedTime,
         twin : twin,
         ioTHubHostName : ioTHubHostName,
         authentication : new AuthenticationMechanismServiceModel(azureDevice.Authentication))
 {
 }
Exemple #2
0
 public DeviceServiceModel(
     string etag,
     string id,
     int c2DMessageCount,
     DateTime lastActivity,
     bool connected,
     bool enabled,
     DateTime lastStatusUpdated,
     DeviceTwinServiceModel twin,
     AuthenticationMechanismServiceModel authentication,
     string ioTHubHostName)
 {
     Etag              = etag;
     Id                = id;
     C2DMessageCount   = c2DMessageCount;
     LastActivity      = lastActivity;
     Connected         = connected;
     Enabled           = enabled;
     LastStatusUpdated = lastStatusUpdated;
     Twin              = twin;
     IoTHubHostName    = ioTHubHostName;
     Authentication    = authentication;
 }