tagged [json.net]
Private setters in Json.Net
Private setters in Json.Net I know there's an attribute to handle private setters but I kind of want this behavior as a default, is there a way to accomplish this? Except tweaking the source. Would be...
JSON date from tweeter to C# format
JSON date from tweeter to C# format How to format a JSON date obtained from twitter to a C# DateTime ? Here is the format of the date I receive : Can I do it with JSON.NET ?
- Modified
- 19 Feb at 16:43
.NET Core 3.0 StringEnumConverter not serializing as string
.NET Core 3.0 StringEnumConverter not serializing as string When decorating your enum with: And serializing it with `JsonConvert.SerializeObject(myEvent)` You may notice that the enum is not serialize...
- Modified
- 8 Oct at 14:14
Add a custom attribute to json.net
Add a custom attribute to json.net JSON.NET comes with property attributes like `[JsonIgnore]` and `[JsonProperty]`. I want to create some custom ones that get run when the serialisation runs e.g. `[J...
- Modified
- 2 Oct at 13:45
Json.Net: JsonSerializer-Attribute for custom naming
Json.Net: JsonSerializer-Attribute for custom naming I use the `JsonSerializer` from Newtonsoft. But i want to name the json-objects by myself. I tried the `JsonObject` attribute `JsonArray` also didn...
- Modified
- 11 Nov at 16:11
How to combine/merge two JArrays in JSON.NET
How to combine/merge two JArrays in JSON.NET I can't figure out how to concatenate two JArrays that I got by using JArray.Parse? The order of the arrays must be preserved i.e. the first array should b...
'Newtonsoft.Json.Linq.JArray' does not contain a definition
'Newtonsoft.Json.Linq.JArray' does not contain a definition I am trying this code: but line 3 gives this error, how come? How do you get this data?
How to create a JSON.NET Date to String custom Converter
How to create a JSON.NET Date to String custom Converter Could someone tell me please how I can create a custom converter I know I can use JSON.NET ISODateConvertor, but what I want is specific, I jus...
Web API serialize properties starting from lowercase letter
Web API serialize properties starting from lowercase letter How can I configure serialization of my Web API to use `camelCase` (starting from lowercase letter) property names instead of `PascalCase` l...
- Modified
- 28 Apr at 12:30
How to convert JSON to XML or XML to JSON?
How to convert JSON to XML or XML to JSON? I started to use Json.NET to convert a string in JSON format to object or viceversa. I am not sure in the Json.NET framework, is it possible to convert a str...
Using JSON to Serialize/Deserialize TimeSpan
Using JSON to Serialize/Deserialize TimeSpan I'm trying to deserialize/serialize a timespan with [Newtonsoft.Json.JsonConvert](https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonConvert.h...
- Modified
- 17 Aug at 12:9
Why ServiceStack.Text doesn't default dates to iso8601?
Why ServiceStack.Text doesn't default dates to iso8601? If I use Newtonsoft.Json.NET it defaults to iso8601 (i.e.: `2011-06-02T09:34:29+02:00`) for serializing/deserializing dates. Why ServiceStack.Te...
- Modified
- 8 Apr at 15:58
Json.NET JsonConvert.DeserializeObject() return null value
Json.NET JsonConvert.DeserializeObject() return null value i tried to this string : ``` string _jsonObject = {\"Ad\":{\"Type\":\"Request"\, \"IdAd\":\"xxx@xxx.com\", \"Category\":\"cat\", ...
- Modified
- 17 Jun at 14:14
How can I beautify JSON for display in a TextBox?
How can I beautify JSON for display in a TextBox? How can I beautify JSON with C#? I want to print the result in a TextBox control. Is it possible to use JavaScriptSerializer for this, or should I use...
How do I incrementally serialize and deserialize JSON with ServiceStack?
How do I incrementally serialize and deserialize JSON with ServiceStack? What I have is this: How do I read the fields until I'm at 'object', then serialize the whole 'object' into a .NET type and the...
- Modified
- 27 Mar at 09:11
JSON.NET Error Self referencing loop detected for type
JSON.NET Error Self referencing loop detected for type I tried to serialize POCO class that was automatically generated from Entity Data Model .edmx and when I used I got the following error: > Error ...
- Modified
- 28 Jan at 21:24
Is polymorphic deserialization possible in System.Text.Json?
Is polymorphic deserialization possible in System.Text.Json? I try to migrate from Newtonsoft.Json to System.Text.Json. I want to deserialize abstract class. Newtonsoft.Json has TypeNameHandling for t...
- Modified
- 23 Nov at 19:26
How to serialize a dynamic object to a JSON string in dotnet core?
How to serialize a dynamic object to a JSON string in dotnet core? I am passing a JSON payload to an API Controller, and one of the fields is dynamic because the field needs to be passed again as a JS...
- Modified
- 29 Feb at 12:14
How to deserialize object derived from Exception class using Json.net?
How to deserialize object derived from Exception class using Json.net? I'm trying to deserialize object derived from Exception class: It gives me error: > ISerial
- Modified
- 10 Jun at 05:35
Generate JSON object with NewtonSoft in a single line
Generate JSON object with NewtonSoft in a single line I'm using the JSON library [NewtonSoft](http://nuget.org/packages/newtonsoft.json) to generate a JSON string: Output: My question: Is it possible ...
How to deserialize class without calling a constructor?
How to deserialize class without calling a constructor? I'm using Json.NET in my WCF data service. Here's my class (simplified): How can I deserialize that class invoking a constructor using `JsonConv...
- Modified
- 19 Dec at 08:10
JSON.NET how to remove nodes
JSON.NET how to remove nodes I have a json like the following: I just want to trans