Abp.Json.JsonHelper.ConvertToJson C# (CSharp) Method

ConvertToJson() public static method

public static ConvertToJson ( object obj, bool camelCase = false, bool indented = false ) : string
obj object
camelCase bool
indented bool
return string
        public static string ConvertToJson(object obj, bool camelCase = false, bool indented = false)
        {
            var options = new JsonSerializerSettings();

            if (camelCase)
            {
                options.ContractResolver = new CamelCasePropertyNamesContractResolver();
            }

            if (indented)
            {
                options.Formatting = Formatting.Indented;
            }

            return JsonConvert.SerializeObject(obj, options);
        }
    }
JsonHelper