IDurableOrchestrationClient.StartNewAsync
-- overloads differ in generic constraints.
#2348
Unanswered
Ilia-Kosenkov
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Thanks for reaching out @Ilia-Kosenkov. This is interesting. It's certainly strange that the generic constraints differ, and I believe it might be just an oversight and that in reality @cgillum: are you familiar with this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Revisiting this discussion later, I found this issue here #1814 which highlights the same problem, and I am surprised it has not been resolved (or at least answered) in more than a year. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working with durable orchestrations, I noticed that
StartNewAsync<T>(string, T)
has aT : class
constraint,azure-functions-durable-extension/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableOrchestrationClient.cs
Lines 142 to 145 in 9af1662
but
StartNewAsync<T>(string, string, T)
has noneazure-functions-durable-extension/src/WebJobs.Extensions.DurableTask/ContextInterfaces/IDurableOrchestrationClient.cs
Line 163 in 9af1662
Is there a reason such a difference exists? For instance,
IDurableOrchestrationContext.GetInput<T>()
, which can be used to obtain said orchestration input, has no such constraint. Furthermore, the documentation states orchestration input should be somethingJSON
-serializable, and sinceJSON.Net
is used, I interpret this as input is anything that can be serialized asJSON
, including simple types likeint
orGuid
and custom-derived types (including value-typestruct
s), which clearly violatesT : class
constraint.Beta Was this translation helpful? Give feedback.
All reactions