public TheOPCSensorSubscription(TheThing.TheSensorSubscription baseSubscription) : base(baseSubscription) { if (baseSubscription.ExtensionData != null) { if (baseSubscription.ExtensionData.TryGetValue(nameof(QueueSize), out var queueSize)) { QueueSize = TheCommonUtils.CIntNullable(queueSize); ExtensionData.Remove(nameof(QueueSize)); } if (baseSubscription.ExtensionData.TryGetValue(nameof(ChangeTrigger), out var changeTrigger)) { ChangeTrigger = TheCommonUtils.CIntNullable(changeTrigger); ExtensionData.Remove(nameof(ChangeTrigger)); } if (baseSubscription.ExtensionData.TryGetValue(nameof(DeadbandValue), out var deadbandValue)) { DeadbandValue = TheCommonUtils.CIntNullable(deadbandValue); ExtensionData.Remove(nameof(DeadbandValue)); } if (baseSubscription.ExtensionData.TryGetValue(nameof(HistoryStartTime), out var historyStartTime)) { HistoryStartTime = TheCommonUtils.CDateNullable(historyStartTime); ExtensionData.Remove(nameof(HistoryStartTime)); } if (baseSubscription.ExtensionData.TryGetValue(nameof(EventInfo), out var eventInfo)) { if (eventInfo is TheEventSubscription) { EventInfo = eventInfo as TheEventSubscription; } else { EventInfo = TheCommonUtils.DeserializeJSONStringToObject <TheEventSubscription>(eventInfo?.ToString()); } ExtensionData.Remove(nameof(EventInfo)); } } }