Skip to content

Commit

Permalink
Merge pull request #81 from Azure/pk/vnext/IExtensibleDataObjectFix
Browse files Browse the repository at this point in the history
Make the data contracts implement IExtensibleDataObject interface
  • Loading branch information
PradeepKadubandi authored Apr 7, 2017
2 parents aa2f778 + dd2463d commit 482cb34
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/DurableTask.Framework/History/HistoryEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/// <summary>
/// Creates a new history event with the supplied eventid
Expand Down Expand Up @@ -72,5 +72,10 @@ public HistoryEvent(int eventId)
/// </summary>
[DataMember]
public virtual EventType EventType { get; private set; }

/// <summary>
/// Implementation for <see cref="IExtensibleDataObject.ExtensionData"/>.
/// </summary>
public ExtensionDataObject ExtensionData { get; set; }
}
}
7 changes: 6 additions & 1 deletion src/DurableTask.Framework/OrchestrationInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace DurableTask
/// Represents the state of an orchestration instance
/// </summary>
[DataContract]
public class OrchestrationInstance
public class OrchestrationInstance : IExtensibleDataObject
{
/// <summary>
/// The instance id, assigned as unique to the orchestration
Expand Down Expand Up @@ -63,5 +63,10 @@ public override string ToString()
{
return $"[InstanceId: {InstanceId}, ExecutionId: {ExecutionId}]";
}

/// <summary>
/// Implementation for <see cref="IExtensibleDataObject.ExtensionData"/>.
/// </summary>
public ExtensionDataObject ExtensionData { get; set; }
}
}
7 changes: 6 additions & 1 deletion src/DurableTask.Framework/OrchestrationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace DurableTask
/// Represents the state of an orchestration
/// </summary>
[DataContract]
public class OrchestrationState
public class OrchestrationState : IExtensibleDataObject
{
/// <summary>
/// Completion datetime of the orchestration
Expand Down Expand Up @@ -92,5 +92,10 @@ public class OrchestrationState
/// The orchestration version
/// </summary>
[DataMember] public string Version;

/// <summary>
/// Implementation for <see cref="IExtensibleDataObject.ExtensionData"/>.
/// </summary>
public ExtensionDataObject ExtensionData { get; set; }
}
}
7 changes: 6 additions & 1 deletion src/DurableTask.Framework/ParentInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace DurableTask
/// Represents the parent orchestation of a sub orchestration
/// </summary>
[DataContract]
public class ParentInstance
public class ParentInstance : IExtensibleDataObject
{
/// <summary>
/// The orchestration name of the parent instance
Expand Down Expand Up @@ -51,5 +51,10 @@ internal ParentInstance Clone()
OrchestrationInstance = OrchestrationInstance.Clone()
};
}

/// <summary>
/// Implementation for <see cref="IExtensibleDataObject.ExtensionData"/>.
/// </summary>
public ExtensionDataObject ExtensionData { get; set; }
}
}
3 changes: 2 additions & 1 deletion src/DurableTask.Framework/StateMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
7 changes: 6 additions & 1 deletion src/DurableTask.Framework/TaskMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace DurableTask
/// Wire level transport object for task messages containing events and orchestration instance information
/// </summary>
[DataContract]
public class TaskMessage
public class TaskMessage : IExtensibleDataObject
{
/// <summary>
/// Even information for this taks message
Expand All @@ -37,5 +37,10 @@ public class TaskMessage
/// The orchestration instance information
/// </summary>
[DataMember] public OrchestrationInstance OrchestrationInstance;

/// <summary>
/// Implementation for <see cref="IExtensibleDataObject.ExtensionData"/>.
/// </summary>
public ExtensionDataObject ExtensionData { get; set; }
}
}

0 comments on commit 482cb34

Please sign in to comment.