Questions tagged [json2csharp]

Convert the json object into C# so that json data can be use in C# code.

This tag is used for such question in which the JSON object will be convert into C# to use the JSON data into C# code.

11 questions
2
votes
3 answers

Deserializing this JSON response to C#

I have this specific JSON response that I am trying to deserialize without success. I am hoping someone can help me. Here is the JSON response I get: { "num_locations": 1, "locations": { "98765": { "street1": "123 Fake Street", …
1
vote
1 answer

Why does the JSON2CSharp online converter decorate each property with a [JsonProperty("...")] attribute?

I have this JSON response from an API: { "arguments": { "Configuration": { "Building_Configuration.Parameters_SP.fixtureStrategy_SP": "ETA", "Building_Configuration.Parameters_SP.dimensionSelection_SP":…
Jeff
  • 21
  • 7
1
vote
0 answers

how to convert json response to c# dictionary?

I have the following json response and I want to convert it into C# model. I am facing the issue that it has key value as integer and when I'm converting it into C# through converter it is making as many classes as these values. how to convert it as…
1
vote
1 answer

How to rename and remap fields with illegal json field names

I have used json2csharp to produce some nice c# class into which I can deserialize json. It is actually working as expected EXCEPT that json2csharp named some of the fields invalid_name . I renamed those to valid csharp names but when serialized…
Seth Spearman
  • 6,710
  • 16
  • 60
  • 105
0
votes
1 answer

Newtonsoft.Json : How to convert json to xml when there are additional properties?

We create an xsd schema that matches a json generate a c# class from the xsd schema Use newtonsoft.json to deserialize the json to object and object to xml(based on the generated class) This is needed as the product we use can only deal with xml…
SriramN
  • 432
  • 5
  • 19
0
votes
1 answer

How to fix wrong Json to C# deserialization of array of strings into property with null value?

For some reason non-empty array of strings in Json after deserialization becomes class property with null value, while it should become non-empty List. Here is…
0
votes
1 answer

Json response to C# Object

I am trying to convert Json Response to C# object. My code is as below. $ HttpResponseMessage response = client.GetAsync(TARGETURL).Result; HttpContent content = response.Content; // ... Check Status Code …
user7868770
0
votes
1 answer

Passing value to Class Object Created using json2csharp

I have created class of below json using json2csharp. { "saveExistingRetailCustomerReq":{ "reqHdr":{ "consumerContext":{ "applicationId":"CRM", "terminalId":"12345" }, …
Manoj Naik
  • 386
  • 4
  • 18
0
votes
3 answers

How to create Models in ASP.Net for multi level Json format?

Problem Specification: Build a web api in asp.net to post multi level json formatted data. Json Format: { "InfoList:"[ { "Name": " Sample String 1", "URL": " Sample String2", "Info":[ { "ZIP": " Sample…
Ruhul Amin
  • 15
  • 11
0
votes
2 answers

Can't access variables on a json class. C#

I recently tried using the twitch json api, i never had experience with json so it was a nice challenge but then i used json2csharp.com and converted a json string to a class like this: class TwitchAPI { public class Preview { public…
0
votes
3 answers

Unable to deserialize the JSON string to object

Guyz I am trying to parse a JSON string into object. I have the below entity in which I am parsing the JSON string public class Room : BaseEntity { public string Name { get; set; } public string EmailAddress { get; set; } public string…
vinod8812
  • 645
  • 10
  • 27