Skip to main content

All Questions

Tagged with
-1 votes
2 answers
74 views

How to deserialize JSON object with nesting [closed]

I am trying to deserialize a JSON object: { "columns":"1", "ctrl":{ "height":"24", "offcolour":"#ff000000",...
SPlatten's user avatar
  • 5,799
0 votes
2 answers
61 views

Converting JSON from API call to C# classes and pass between Blazor components

First time working with JSON in C#. I'm building a Blazor app using Amadeus API data (flights search) and I cannot seem to be able to use the JSON object in a Blazor component. The error I'm getting: ...
Fab's user avatar
  • 153
0 votes
1 answer
54 views

ASP.NET Core 8 - Configuration.GetConnectionString() returns null despite appsettings.json setup

I'm working on an ASP.NET Core 8 Web API project using Entity Framework Core. I've added my connection string to appsettings.json, but when I try to retrieve it using Configuration.GetConnectionString(...
Idowu Olusegun Kelvin's user avatar
0 votes
0 answers
72 views

Ajax call return status as 200 but goes to Error callback [closed]

Our Ajax call is successfully fetching value from DB, but it is going to Error callback but status code is shown as 200. In controller, we verified the value is returned as 1 which is expected. In ...
Annapoorani R's user avatar
1 vote
0 answers
57 views

How to deserialize JSON in C#? Is the input format data correct? [duplicate]

I need to deserialize a JSON data containing list of players into a regular List<> type (in C#). My code is: public async Task<Player2> RetrievePlayerListFromServer() { ...
Krzysztof Tanaś's user avatar
0 votes
1 answer
92 views

ASP.NET Core model binding ignore extra JSON content

ASP.NET Core Web API endpoint accepts malformed JSON with multiple objects, but only processes the first object, instead of rejecting the request. The API endpoint I'm working on should accept only a ...
Sumrender Singh's user avatar
1 vote
2 answers
96 views

JsonSerializer not working in release build uwp

When serializing a complex record in an UWP application, it works fine in debug mode, but in release mode, when application is packaged using Windows application packaging project, the JsonSerializer ...
gPok's user avatar
  • 21
1 vote
2 answers
124 views

Deserialize incoming JSON sensor data

I am working on a client server application, where client program is python and server program is C#. Server starts receiving sensor data as shown in the below format {"ACP": 15, "...
Vijayakumar Sargunam's user avatar
0 votes
0 answers
57 views

Amend ASP.NET Web API to not use Newtonsoft.Json

I am in the process of updating one of our systems to use System.Text.Json rather than Newtonsoft.Json. I have a Data class that I have amended to use System.Text.Json. This handles calls from MVVM ...
Andrew Northcote's user avatar
0 votes
1 answer
39 views

How to Deserialize json document using reflection.emit.modulebuilder in system.text.json [closed]

We have a local Web API used for internal clients to retrieve data. We use application/json to transport the data across the Web API. The retrieved JSON data has a simple structured class 'Response'. ...
Andrew Northcote's user avatar
0 votes
1 answer
48 views

How to transfer EF Core object graph via json to other database

I'm trying to create a mechanism to export and import an object graph via a json file from to EF Core. The object graph is stored and used from a database, and this needs to be transferable. One ...
Jeroen3's user avatar
  • 945
0 votes
0 answers
47 views

C# When deserializing a Json, how to avoid a specific property being deserialized into? [duplicate]

Having trouble finding the right way to describe the issue to find a solution for it. But here's a quick rundown. I'm using Newtonsoft Json plugin for the following: A Json is being deserialized based ...
Vlad SD's user avatar
  • 281
1 vote
1 answer
111 views

System.Text.Json doesn't deserialize IEnumerable with a private getter

I'm deserializing a series of objects from a third party source. There are a number of different formats, but once I have deserialized them, I want them all to have a common interface. So I have my ...
PaulH567's user avatar
  • 189
0 votes
0 answers
46 views

Can't upload JSON file and reference it in OpenAI prompts

I'm trying to use the OpenAI C# SDK to upload a JSON file and reference it in prompts. If I include it in a UserChatMessage then this exception is thrown: System.ClientModel.ClientResultException: '...
Justin's user avatar
  • 18.3k
3 votes
1 answer
87 views

How Can I Ignore One Property based on JsonProperty Value of another Property during Deserialization?

I have the following class, how can I ignore the Response, if StatusCode == 400? If StatusCode is 400, Response is returned in a different format that doesn't match my APIResponse class and throws an ...
CSharpData's user avatar

15 30 50 per page
1
2 3 4 5
1816