From dd2463d73bf5da9ae57d0e912350452607ae843d Mon Sep 17 00:00:00 2001 From: Pradeep Kadubandi Date: Thu, 6 Apr 2017 10:57:18 -0700 Subject: [PATCH] Make the data contracts implement IExtensibleDataObject interface for round tripping support in future versions. --- src/DurableTask.Framework/History/HistoryEvent.cs | 7 ++++++- src/DurableTask.Framework/OrchestrationInstance.cs | 7 ++++++- src/DurableTask.Framework/OrchestrationState.cs | 7 ++++++- src/DurableTask.Framework/ParentInstance.cs | 7 ++++++- src/DurableTask.Framework/StateMessage.cs | 3 ++- src/DurableTask.Framework/TaskMessage.cs | 7 ++++++- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/DurableTask.Framework/History/HistoryEvent.cs b/src/DurableTask.Framework/History/HistoryEvent.cs index 475bef554..0d1624d7c 100644 --- a/src/DurableTask.Framework/History/HistoryEvent.cs +++ b/src/DurableTask.Framework/History/HistoryEvent.cs @@ -36,7 +36,7 @@ namespace DurableTask.History [KnownType(typeof (EventRaisedEvent))] [KnownType(typeof (ContinueAsNewEvent))] [KnownType(typeof (HistoryStateEvent))] - public abstract class HistoryEvent + public abstract class HistoryEvent : IExtensibleDataObject { /// /// Creates a new history event with the supplied eventid @@ -72,5 +72,10 @@ public HistoryEvent(int eventId) /// [DataMember] public virtual EventType EventType { get; private set; } + + /// + /// Implementation for . + /// + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file diff --git a/src/DurableTask.Framework/OrchestrationInstance.cs b/src/DurableTask.Framework/OrchestrationInstance.cs index 61556dd2c..b759f1726 100644 --- a/src/DurableTask.Framework/OrchestrationInstance.cs +++ b/src/DurableTask.Framework/OrchestrationInstance.cs @@ -19,7 +19,7 @@ namespace DurableTask /// Represents the state of an orchestration instance /// [DataContract] - public class OrchestrationInstance + public class OrchestrationInstance : IExtensibleDataObject { /// /// The instance id, assigned as unique to the orchestration @@ -63,5 +63,10 @@ public override string ToString() { return $"[InstanceId: {InstanceId}, ExecutionId: {ExecutionId}]"; } + + /// + /// Implementation for . + /// + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file diff --git a/src/DurableTask.Framework/OrchestrationState.cs b/src/DurableTask.Framework/OrchestrationState.cs index 71156b502..e8975e40a 100644 --- a/src/DurableTask.Framework/OrchestrationState.cs +++ b/src/DurableTask.Framework/OrchestrationState.cs @@ -21,7 +21,7 @@ namespace DurableTask /// Represents the state of an orchestration /// [DataContract] - public class OrchestrationState + public class OrchestrationState : IExtensibleDataObject { /// /// Completion datetime of the orchestration @@ -92,5 +92,10 @@ public class OrchestrationState /// The orchestration version /// [DataMember] public string Version; + + /// + /// Implementation for . + /// + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file diff --git a/src/DurableTask.Framework/ParentInstance.cs b/src/DurableTask.Framework/ParentInstance.cs index 40badc72d..17285c968 100644 --- a/src/DurableTask.Framework/ParentInstance.cs +++ b/src/DurableTask.Framework/ParentInstance.cs @@ -19,7 +19,7 @@ namespace DurableTask /// Represents the parent orchestation of a sub orchestration /// [DataContract] - public class ParentInstance + public class ParentInstance : IExtensibleDataObject { /// /// The orchestration name of the parent instance @@ -51,5 +51,10 @@ internal ParentInstance Clone() OrchestrationInstance = OrchestrationInstance.Clone() }; } + + /// + /// Implementation for . + /// + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file diff --git a/src/DurableTask.Framework/StateMessage.cs b/src/DurableTask.Framework/StateMessage.cs index 3507b6619..85b60331a 100644 --- a/src/DurableTask.Framework/StateMessage.cs +++ b/src/DurableTask.Framework/StateMessage.cs @@ -16,8 +16,9 @@ namespace DurableTask using System.Runtime.Serialization; [DataContract] - internal class StateMessage + internal class StateMessage : IExtensibleDataObject { [DataMember] public OrchestrationState State; + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file diff --git a/src/DurableTask.Framework/TaskMessage.cs b/src/DurableTask.Framework/TaskMessage.cs index ff64efda1..db0026951 100644 --- a/src/DurableTask.Framework/TaskMessage.cs +++ b/src/DurableTask.Framework/TaskMessage.cs @@ -21,7 +21,7 @@ namespace DurableTask /// Wire level transport object for task messages containing events and orchestration instance information /// [DataContract] - public class TaskMessage + public class TaskMessage : IExtensibleDataObject { /// /// Even information for this taks message @@ -37,5 +37,10 @@ public class TaskMessage /// The orchestration instance information /// [DataMember] public OrchestrationInstance OrchestrationInstance; + + /// + /// Implementation for . + /// + public ExtensionDataObject ExtensionData { get; set; } } } \ No newline at end of file