Skip to content

Commit bc082b6

Browse files
committed
Relax conversion type requirements
1 parent 086a026 commit bc082b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Worker.Extensions.DurableTask/OrchestrationInputConverter.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ public ValueTask<ConversionResult> ConvertAsync(ConverterContext context)
5858
// We only convert if:
5959
// 1. The "Source" is null - IE: there are no declared binding parameters.
6060
// 2. We have a cached input.
61-
// 3. The TargetType matches our cached type.
61+
// 3. The TargetType is either:
62+
// a. TargetType is in the inheritance hierarchy of the cached input (i.e. an ancestor type),
63+
// b. TargetType is an interface implemented by the cached input.
6264
// If these are met, then we assume this parameter is the orchestration input.
6365
if (context.Source is null
6466
&& context.FunctionContext.Items.TryGetValue(OrchestrationInputKey, out object? value)
65-
&& context.TargetType == value?.GetType())
67+
&& context.TargetType.IsInstanceOfType(value))
6668
{
6769
// Remove this from the items so we bind this only once.
6870
context.FunctionContext.Items.Remove(OrchestrationInputKey);

0 commit comments

Comments
 (0)