@manhnguyenv

Welcome to my blog!

JSON

November 7, 2017 10:09

camelCase JSON Serialized

Install-Package Newtonsoft.Json

Convert object to JSON with camelCase format

var jsonSerializerSettings = new JsonSerializerSettings
{
       ContractResolver = new CamelCasePropertyNamesContractResolver()
};
var json = JsonConvert.SerializeObject(obj, jsonSerializerSettings);

 

Refer:

https://codehollow.com/2017/05/return-json-from-csharp-azure-function/

https://stackoverflow.com/questions/19445730/how-can-i-return-camelcase-json-serialized-by-json-net-from-asp-net-mvc-controll

Categories

Recent posts