mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-09 11:21:04 +08:00
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:
@@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.Forms.Services;
|
using Orchard.Forms.Services;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
@@ -30,7 +31,7 @@ namespace Orchard.Workflows.Models {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void SetState<T>(string key, T value) {
|
public void SetState<T>(string key, T value) {
|
||||||
State[key] = value;
|
State[key] = JToken.FromObject(value);
|
||||||
SerializeState();
|
SerializeState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user