From 47e0795b662fab1099d5ebb41c3bb4d99cc455ac Mon Sep 17 00:00:00 2001 From: Andale-online Date: Sat, 16 Nov 2019 15:30:04 +0100 Subject: [PATCH] Feature variables v2.01 with bugfix (#164) * Changed Variables.cs to full IDictionary with ConcurrentDictionary backing * Bugfix for long running flows --- src/core/Elsa.Abstractions/Models/Variables.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/Elsa.Abstractions/Models/Variables.cs b/src/core/Elsa.Abstractions/Models/Variables.cs index 03c37133e..f37af48c4 100644 --- a/src/core/Elsa.Abstractions/Models/Variables.cs +++ b/src/core/Elsa.Abstractions/Models/Variables.cs @@ -108,6 +108,12 @@ namespace Elsa.Models { object value; objects.TryGetValue(name, out value); + + if(value != null && ((value.GetType() == typeof(JValue) || value.GetType() == typeof(JToken)) && value.GetType() != typeof(T))) + { + value = ((JToken)value).ToObject(); + } + return value == null ? default : (T)value; }