Feature variables v2.01 with bugfix (#164)

* Changed Variables.cs to full IDictionary
with ConcurrentDictionary<string, object> backing

* Bugfix for long running flows
This commit is contained in:
Andale-online 2019-11-16 15:30:04 +01:00 committed by Sipke Schoorstra
parent d1f7ce47b7
commit 47e0795b66

View file

@ -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<T>();
}
return value == null ? default : (T)value;
}