Serializing Entity Framework problems

后端 未结 5 1959
無奈伤痛
無奈伤痛 2020-12-16 05:15

Like several other people, I\'m having problems serializing Entity Framework objects, so that I can send the data over AJAX in a JSON format.

I\'ve got the following

5条回答
  •  天涯浪人
    2020-12-16 05:26

    I have just successfully tested this code.

    It may be that in your case your Message object is in a different assembly? The overriden Property SupportedTypes is returning everything ONLY in its own Assembly so when serialize is called the JavaScriptSerializer defaults to the standard JavaScriptConverter.

    You should be able to verify this debugging.

提交回复
热议问题