Skip to content

Commit d7dae33

Browse files
committed
Add Version property to OrchestrationContext class
1 parent 0bf00dc commit d7dae33

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/DurableSDK/OrchestrationContext.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,19 @@ public class OrchestrationContext
3636
internal OrchestrationActionCollector OrchestrationActionCollector { get; } = new OrchestrationActionCollector();
3737

3838
internal object CustomStatus { get; set; }
39+
40+
public string Version
41+
{
42+
get
43+
{
44+
if (History == null)
45+
{
46+
return null;
47+
}
48+
49+
var executionStartedEvent = Array.Find(History, e => e.EventType == HistoryEventType.ExecutionStarted);
50+
return executionStartedEvent?.Version;
51+
}
52+
}
3953
}
4054
}

0 commit comments

Comments
 (0)