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

This commit is contained in:
Sipke Schoorstra
2013-11-29 00:42:25 +01:00
parent a2d91796d1
commit 8f35d97621

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using Orchard.ContentManagement;
using Orchard.Forms.Services;
using Orchard.Localization;
@@ -30,7 +31,7 @@ namespace Orchard.Workflows.Models {
}
public void SetState<T>(string key, T value) {
State[key] = value;
State[key] = JToken.FromObject(value);
SerializeState();
}