public Device(Azure.Devices.Device azureDevice, DeviceTwin 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, primaryKey : azureDevice.Authentication.SymmetricKey.PrimaryKey) { }
public Device( string etag, string id, int c2DMessageCount, DateTimeOffset lastActivity, bool connected, bool enabled, DateTimeOffset lastStatusUpdated, DeviceTwin twin, string primaryKey, string ioTHubHostName) { this.Etag = etag; this.Id = id; this.C2DMessageCount = c2DMessageCount; this.LastActivity = lastActivity; this.Connected = connected; this.Enabled = enabled; this.LastStatusUpdated = lastStatusUpdated; this.Twin = twin; this.IoTHubHostName = ioTHubHostName; this.AuthPrimaryKey = primaryKey; }