From 3138c33903336b2fa4ffe0be1124d056091eee85 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 15 Apr 2021 14:39:31 +0200 Subject: [PATCH] Add JObject type conversion handling --- .../Services/EnumerableResultConverter.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripting/Elsa.Scripting.JavaScript/Services/EnumerableResultConverter.cs b/src/scripting/Elsa.Scripting.JavaScript/Services/EnumerableResultConverter.cs index b92a50ccf..7c523c2b1 100644 --- a/src/scripting/Elsa.Scripting.JavaScript/Services/EnumerableResultConverter.cs +++ b/src/scripting/Elsa.Scripting.JavaScript/Services/EnumerableResultConverter.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Dynamic; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace Elsa.Scripting.JavaScript.Services { @@ -20,6 +21,7 @@ namespace Elsa.Scripting.JavaScript.Services object? ConvertEnumerable(IEnumerable enumerable, Type? desiredType = null) { if(enumerable is string) return enumerable; + if(enumerable is JObject) return enumerable; var destinationType = GetDestinationType(desiredType); var json = JsonConvert.SerializeObject(enumerable);