Fixing RuntimeBinderException ("Cannot implicitly convert type 'Foo' to 'Newtonsoft.Json.Linq.JToken'") when getting a complex type from the workflow state.

This commit is contained in:
Sipke Schoorstra
2013-11-29 00:51:49 +01:00
parent 8f35d97621
commit a6a481b78a

View File

@@ -40,7 +40,8 @@ namespace Orchard.Workflows.Models {
return default(T);
}
return (T)State[key];
var value = State[key];
return value != null ? value.ToObject<T>() : default(T);
}
public object GetState(string key) {