Newtonsoft JSON dynamic property name

前端 未结 5 2038
忘了有多久
忘了有多久 2020-11-30 07:34

Is there a way to change name of Data property during serialization, so I can reuse this class in my WEB Api.

For an example, if i am returning paged list of users,

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 08:14

    have a look here: How to rename JSON key

    Its not done during serialization but with a string operation.

    Not very nice (in my eyes) but at least a possibility.

    Cheers Thomas

提交回复
热议问题