Is there any plan for supporting nullable JsonElements?
See original GitHub issueIf not is there any interest this functionality? I’d be happy to work on it. An example use case would be this:
public class Entity {
public JsonElement? Property { get; set; }
}
var johns = context.Entities.Where(e => e.HasValue && e.Value.GetProperty("name").GetString() == "john");
You can currently work around this with the JsonExists extensions and an explicit cast, but it would be nice to have.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Include Null Values in JSON - SQL Server
In this article. To include null values in the JSON output of the FOR JSON clause, specify the INCLUDE_NULL_VALUES option. If you don't...
Read more >Handling JSON null and empty arrays and objects
JSON has a special value called null which can be set on any type of data including arrays, objects, number and boolean types....
Read more >Using Optional and Nullable Properties in API Requests
Learn how optional and nullable properties can be used flexibly in combinations in each parameter of your API requests made from a SDK....
Read more >nullable vs type arrays (JSON Schema compatibility) #1389
I understand that fully supporting type arrays is a challenge for a variety of reasons. I would like to suggest that a compromise...
Read more >C# 8.0 nullable references and serialization
C# 8's nullable references feature can clash with common serialization techniques. This article shows how to deal with that.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tommymh any luck with that repro?
@roji thanks for the reply, I am actually using JsonExists to verify that a property inside the top level document exists, so that I can be sure it isn’t null(not ideal, I know). The error I’m getting is that the query can’t be translated to SQL and I should try client side evaluation, or something to that effect. I will try to remove my application specific business logic and put an example repo together that can reproduce the issue.