Most voted "newtonsoft" questions
13 questions
Sort by count of
-
3
votes1
answer512
viewsSerialize composite object into a single json
With Newtonsoft.Json, to the next object: public class Person { public string Name { get; set; } public string GeneralText { get; set; } public Address Address { get; set; } } public class Address {…
-
2
votes2
answers141
viewsHow to create a class and pass an attribute value in the class constructor in C#
Hello, I’m making an integration with the Tray Comerce API and thought to generate a generic class with the response of lists. In all listings, the API implements the following return class: public…
-
2
votes1
answer2142
viewsRead a value inside a complex JSON in C#
Good morning folks! I’m new to C# and I’m having a hard time picking up a value within a complex Json. This is Json: { "id": "58e50b82-50b1-4f29-a2e8-a9a544013255", "timestamp":…
-
1
votes1
answer39
viewsNewtonsoft catch part of JSON
I’m working with C# and I want to take part of JSON returned by request PostAsync and this is the return of REQUEST: {"meta":{"status":422,"error":true},"error":{"status":1102,"msg":"Invalid email,…
-
1
votes1
answer123
viewsJsonproperty(Propertyname) does not recognize and assign values to the object
I’m creating a API, POST method, where the payload consists of 3 classes with the following structure: //Classe principal do payload public class Representante { [JsonProperty(PropertyName =…
-
0
votes0
answers414
viewsHow to convert a json return to a C# object display the result on the screen
I’m having a little trouble reading a JSON and convert to an Object and display the data on the screen using C#, I’m using the lib Newtonsoft and would like to know how to check if the data type is…
-
0
votes1
answer200
viewsNewtonsoft.Json.Jsonconvert.Serializeobject excluding @
I am running Schema for my page and need to convert the information to print it in JSON. However Newtonsoft.Json.JsonConvert.SerializeObject(schema); removes "@" from "@context" and "@type". Like…
-
0
votes1
answer35
viewsJsonconvert.Deserializeobject is not reading the value of my json. (Values returning to null)
I am trying to read a simple json file that will possess the path to some audio files. Nothing complicated. Follow below the json: { "audioSetup": { "buttonNumpad1AudioFile":…
-
-1
votes2
answers94
viewsWhat is the best way to add a static method to an existing class in C#?
I’m creating an app restfull using the library Newtonsoft to send information through controllers. In my application, I have numerous classes such as user: public class UsuarioModel { public int Id…
-
-1
votes1
answer221
viewsParse de Json in C#
I’m trying to parse Json for a listbox and I’m not succeeding. This url is an example of what I’m trying to parse... and this is what I have: public void button1_Click(object sender, EventArgs e) {…
-
-1
votes2
answers75
viewsHow to serialize or deserialize a json with lowercase keys and uppercase values (newtonsoft)
I have the following JSON string example: : { myproperty : 'Hello' } When I desiccate you or serialize you, I want you to stay that way: { myproperty : 'HELLO' } All values in Uppercase and All Keys…
-
-1
votes2
answers73
viewsC# Newtonsoft.Json - Add property during serialization
Hello! I’m trying to customize the serialization of a class using the Newtonsoft.Json. My intention is to add a property in JSON during the serialization of the object. Following the official…
-
-4
votes1
answer123
viewsThe name "Json" does not exist in the current context
Good afternoon, I have the following part of my class that would serve to feed the objects obtained through a json online. public JsonResult GetJson() { string res; WebClient client = new…