We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ToJson
1 parent 7f611f0 commit 63ffaaeCopy full SHA for 63ffaae
AspNetCoreVueMpa.Web/Utils/ObjectExtensions.cs
@@ -0,0 +1,19 @@
1
+using Newtonsoft.Json;
2
+using Newtonsoft.Json.Serialization;
3
+
4
+namespace AspNetCoreVueMpa.Web.Utils
5
+{
6
+ public static class ObjectExtensions
7
+ {
8
+ public static string ToJson(this object obj)
9
10
+ var settings = new JsonSerializerSettings
11
12
+ ContractResolver = new CamelCasePropertyNamesContractResolver(),
13
+ NullValueHandling = NullValueHandling.Ignore,
14
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore
15
+ };
16
+ return JsonConvert.SerializeObject(obj, settings);
17
+ }
18
19
+}
0 commit comments