Skip to content

Commit 5ec38b2

Browse files
committed
foreach collection conversion
1 parent 0fb0440 commit 5ec38b2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/WorkflowCore.DSL/Services/DefinitionLoader.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,12 @@ void acn(IStepBody pStep, object pData, IStepExecutionContext pContext)
268268
if (stepProperty.PropertyType.IsEnum)
269269
stepProperty.SetValue(pStep, Enum.Parse(stepProperty.PropertyType, (string)resolvedValue, true));
270270
else
271-
stepProperty.SetValue(pStep, System.Convert.ChangeType(resolvedValue, stepProperty.PropertyType));
271+
{
272+
if ((resolvedValue != null) && (stepProperty.PropertyType.IsAssignableFrom(resolvedValue.GetType())))
273+
stepProperty.SetValue(pStep, resolvedValue);
274+
else
275+
stepProperty.SetValue(pStep, System.Convert.ChangeType(resolvedValue, stepProperty.PropertyType));
276+
}
272277
}
273278
return acn;
274279
}

src/WorkflowCore.DSL/WorkflowCore.DSL.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>3.1.4</Version>
5+
<Version>3.1.5</Version>
66
<Description>DSL extenstion for Workflow Core provding support for JSON and YAML workflow definitions.</Description>
77
<Authors>Daniel Gerlag</Authors>
88
<Company />

0 commit comments

Comments
 (0)