Parse Diagram Model

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]'.'

1 Reply

SG Shyam G Syncfusion Team June 28, 2018 10:27 AM UTC

Hi Luis,  
 
The reported issue is a known issue and it has been fixed in our Essential Studio Volume 2, 2018 (Version 16.2.0.41) which is rolled out and is available for download under the following link.  
  
   
Regards,  
Shyam G  


Loader.
Up arrow icon