This tag can be used when you want to convert any text, objects or other formats into a JSON object,or if you want to transform a JSON object into something else.
Questions tagged [jsonconvert]
207 questions
0
votes
1 answer
MethodInfo.Invoke is failing when parameter is of type Enum
I'm having one method like the following, where Days is an Enum having values from Sunday to Saturday, Which I'm calling using reflection. I'm having lots of similar methods with different signatures And the input parameters are also dynamic which…

sujith karivelil
- 28,671
- 6
- 55
- 88
0
votes
0 answers
JsonConvert.DeserializeObject() does not work
I want to update a json file that is represented by my class ConfigFile. ConfigFile attributes are all static. A have a LocalService class that have an UpdateConfigFile method that takes the address of the config file and update its content with a…

Florent Yovo
- 9
- 1
0
votes
1 answer
Json.NET JsonConvert.DeserializeObject()
how can i get the "Points" value using JsonConvert.DeserializeObject can anyone help me
{
"data":
{
"Gamers": [
{
"id": "5397742571",
"startTime": "Thu, 28 Jun 2022 00:04:13 GMT",
"points": 11.647601,
"hash": {
"id": "xxxxxxxxxxxx",
"hash":…

jefferson soares
- 13
- 2
0
votes
2 answers
Asp .Net Core Json deserialize to model
Returns Json format data to me from an api.
However, the type of the "FuelType" property inside the object may be different. For example, 1 time comes as follows:
{
...
fuelType: "gasoline"
...
}}
But then it can happen:
{
...
fuelType:…

Elchin
- 39
- 6
0
votes
0 answers
Newtonsoft.Json.JsonConvert how to redact values?
I want to log the serialized string but it is a sensitive data.
I only need to log property names, not values for example if I get a null reference error, I only need to know which property exist in the object. I actually use the original object to…

yılmaz
- 365
- 1
- 14
0
votes
1 answer
Use non-nullable reference types in DTO:s/api objects
I want to use non-nullable reference type in my dto:s/api objects, without getting warnings and without defeating the entire purpose by using them by using the bang operator.
Lets say I consume from an GraphQL-endpoints that returns a hierarchy of…

Cowborg
- 2,645
- 3
- 34
- 51
0
votes
1 answer
Mapbox matching response convert to dynamic json in ASP.NET Core
I want to use mapbox matching in ASP.NET Core. This link you can get response https://api.mapbox.com/matching/v5/mapbox/driving/..
I want to convert this response to dynamic json in Asp.net core, I use this line
var jsonResponse =…

Mu nt
- 93
- 1
- 1
- 9
0
votes
2 answers
how to deserialize json into dictionary c# and define the key?
I have this class:
public class Campaign{
public int campaign_id { get; set; }
public string campaign_name { get; set; }
public int representative_id { get; set; }}
And I can deserialize the JSON to a List like this:
…

ILovePizza
- 141
- 1
- 8
0
votes
1 answer
Is there any possible way to deserialize a Json file made from a list of objects to a list of the same objects in c# and how can it be done?
I tried many different codes to deserialize the objects from a Json_List but every time the list, in which my objects should be saved gets the null value even after the deserialization. BTW I am using the Newtonsoft.Json Namespace. It worked just…

Ahmed Ha. K
- 23
- 5
0
votes
2 answers
How to Save Large Json Data?
i have a large ObservableCollection that I want to get out as Json file.
I used the following code, But I get an error out of memory
string json = JsonConvert.SerializeObject(content, Formatting.Indented);
await…

Atena
- 109
- 2
- 9
0
votes
2 answers
How to inject dependency in Newtonsoft JsonConverter in .net core 5.0
I am trying to call a web API from my web application. I am using .Net 5.0 and while writing the code I am getting the error:
"The name 'JsonConvert' does not exist in the current "definition JsonConvert.DeserializeObject method.
So my question is…

Sanuri Perera
- 1
- 1
0
votes
3 answers
text.json deserialize i get a error c# conversion error
I am pulling data from API. I am getting an error while deserializing. please help me.
error:
System.Text.Json.JsonException: '',' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 0 | BytePositionInLine: 128.'
data…

batuhan343434
- 57
- 7
0
votes
1 answer
C# Batch deserialization of a lot of json files
I have 200.000 json files on file system.
Deserializing them one-by-one and putting them in a List takes about 4 minutes.
I am looking for fastest way to deserialize them or a way to deserialize them all at once.
Code Sample
The code i am using is…

Hossein
- 1,640
- 2
- 26
- 41
0
votes
2 answers
C# Json converting hex literal string to int
A bit stuck, (confusing myself really, I think).
I am wanting to convert a value from a JSON string from it String representation of hex to an int. I only need to get the value I will never need to write the other way.
For instance
{
"name" :…

Angryjames
- 77
- 9
0
votes
0 answers
ASP.Net Core Api: how to deserialize a double-serialized JSON object
I'm using a central API in ASP.Net Core to authenticate users and to create JSON Web Tokens. The central API, in turn, calls other APIs to get other data, such as user profile data and subscription information. However, the central API receives…

IMOsiris
- 111
- 1
- 2
- 11