SPA, JSON, Datetime madness RRS feed

  • Question

  • User1916654149 posted


    Since changing the serialization to JSON.net like blogged about (Scott Hanselman, Rick Strahl and Henrikn

    I see normal JSON dates going over the wire but when persisting entities to the server I now get this issue.

    This DataController does not support operation 'Update' for entity 'JObject'

    This issue is already on stackoverflow but the answer didn't work for me.

    Does anybody has a solution by using a serializer instead of parsing it manually.

    Thanks in advance

    Tuesday, March 13, 2012 5:42 AM

All replies

  • User-2045101248 posted

    I'm getting this too today..

     currently causes an exception in DbDataController Message=This DataController does not support operation 'Insert' for entity 'JObject'.
                //StackTrace=   at System.Web.Http.Data.DataController.ResolveActions(DataControllerDescription description, IEnumerable`1 changeSet)
                //at System.Web.Http.Data.DataController.Submit(ChangeSet changeSet)

    and also another related issue I get, the symptoms are a valid model but a 400 Bad request is returned. Identified as 'DateTime doesn't roundtrip correctly' by someone in the MS team to JNK on the web.api. The issue has been supposedly 'closed' but it is not clear whether it closed 'fixed' or closed this is 'just a feature'.

    Tuesday, March 13, 2012 11:14 AM
  • User-1343624898 posted

    I'm getting the same error. Any solutions?

    Tuesday, March 27, 2012 11:29 PM
  • User1622957740 posted

    Hmmm... I see no problem with straight ApiController methods (ie. no DataController) which receive complex types without a problem

    What is the code for the target method? Is the error occurring after the binding has occurred or somewhere else?

    It seems that this has something to do with the DataController/DbDataController class for SPA (?) applications maybe? I haven't looked at that yet, so I'm not sure what it does but it would appear that the framework is using a separate parsing mechanism that used to rely on JsonObject previously and now uses JObject instead which fails.

    Sounds like a bug in DataController which appears to be hardcoded to the stock serializers/JSON objects.

    Know this doesn't fix but may help shed some light on the issue.

    +++ Rick ---

    Wednesday, March 28, 2012 9:14 PM