I am saving the model using this function:
var saveData = diagram.save();
var jsonToPost = JSON.stringify(saveData);
$.ajax({
url: "/Diagram/SaveNewWorkflow",
type: "POST",
data: { "stringify": jsonToPost },
success: function () {
alert("Success");
return true;
},
});
On the controller side i have:
public async void SaveNewWorkflow(string stringify)
{
DiagramBuilderModel m = new DiagramBuilderModel();
m.Model.ParseModel(stringify);
This give me an error:
System.InvalidCastException: 'Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'.'