[CLOSED] Specify how object is serialized in DirectMethod

  1. #1

    [CLOSED] Specify how object is serialized in DirectMethod

    I have a directmethod that returns an object. Is it possible to make the serialization use the CamelCasePropertyNamesContractResolver? The object has property called Name but I need it to be "name" once serialized. If I return a string and encode back on clientside, I can make it work but just wondering if there's a better way.

    JSON.Serialize(someObject, New Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
    Last edited by Daniil; Jan 15, 2013 at 4:08 AM. Reason: [CLOSED]
  2. #2
    You can serialize value manually to string as required, wrap by JRawValue and return in direct method
    return JRawValue.From(json_string);

Similar Threads

  1. Replies: 4
    Last Post: Oct 27, 2012, 10:59 AM
  2. Replies: 1
    Last Post: Sep 13, 2011, 5:19 PM
  3. [CLOSED] Serialized Microsoft Date Format
    By mkshields9w57 in forum 1.x Help
    Replies: 8
    Last Post: Jul 29, 2011, 5:17 PM
  4. DateTime.MinValue serialized as null
    By nextSTEP in forum 1.x Help
    Replies: 3
    Last Post: Mar 11, 2011, 5:46 PM
  5. Replies: 1
    Last Post: Aug 25, 2009, 10:27 AM

Posting Permissions