Newtonsoft.Json replacing spaces with underscores C# to JSON Serialize [duplicate]
问题 This question already has answers here : How to apply a general rule for remapping all property names when serializing with Json.NET? (2 answers) Closed 2 years ago . INITIAL QUESTION: Here I have a function I use to convert from Entity Framework object to JSON: public class JSON { public static string ConvertEntityToJSON(object dataToSerialize) { return JsonConvert.SerializeObject(dataToSerialize, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); } } When