-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON: support for weakly typed json properties #28871
Comments
Postgresql's EF Core allows direct mapping with JsonDocument, e.g. public class SomeEntity : IDisposable
{
public JsonDocument Customer { get; set; }
}
More details here: https://www.npgsql.org/efcore/mapping/json.html#jsondocument-dom-mapping I would prefer these to be consistent, right now I'm writing a library that I would like to work with Postgresql and SQLite, I have to write JsonDocument has one drawback it is IDisposable, it makes all entities IDisposable as well, this is not what I would want though. I think JsonNode could be a better value type. |
Currently we only support strongly typed POCO objects that map to JSON and are reflected in our metadata. We should also allow weakly typed properties, i.e.
JsonDocument
/JsonNode
, that would not be reflected in our metadata and support query viaGetProperty
and various Get* methods (e.g. GetInt32) to retrieve the final scalar result.The text was updated successfully, but these errors were encountered: