/// <summary>
            /// Create device
            /// </summary>
            /// <param name="outer"></param>
            /// <param name="device"></param>
            /// <param name="twin"></param>
            public IoTHubDeviceModel(IoTHubServices outer,
                                     DeviceModel device, DeviceTwinModel twin)
            {
                _outer = outer;

                Device = device.Clone();
                Twin   = twin.Clone();

                // Simulate authentication
                if (Device.Authentication == null)
                {
                    Device.Authentication = new DeviceAuthenticationModel {
                        PrimaryKey = Convert.ToBase64String(
                            Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())),
                        SecondaryKey = Convert.ToBase64String(
                            Encoding.UTF8.GetBytes(Guid.NewGuid().ToString()))
                    };
                }
                if (Device.ConnectionState == null)
                {
                    Device.ConnectionState = "Disconnected";
                }
                if (Twin.ConnectionState == null)
                {
                    Twin.ConnectionState = "Disconnected";
                }
                if (Twin.Status == null)
                {
                    Twin.Status = "enabled";
                }
                if (Twin.StatusUpdatedTime == null)
                {
                    Twin.StatusUpdatedTime = DateTime.UtcNow;
                }
                if (Twin.LastActivityTime == null)
                {
                    Twin.LastActivityTime = DateTime.UtcNow;
                }
                Twin.Etag = Device.Etag = Guid.NewGuid().ToString();
            }