You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to find the provider's JsonTypeMapping, our code currently does a standard lookup with CLR type JsonElement (as a sort of special value). The problem is that some provider's actually do support JsonElement as a real property CLR type; in addition, if a user defines a JsonElement property on some entity type, this type mapping will be return, and things will likely fail in some unpredictable way.
We should find another way to look up the JsonTypeMapping, e.g. define some special CLR type instead of JsonElement that could be used, or introduce a new API or something.
This is unfortunately more than a cleanup - the current hacky way of doing things in EFCore.PG unfortunately doesn't take care of literal generation, which is necessary e.g. when adding a column to an existing table (for the default value). There, CSharpHelper.UnknownLiteral is used, which just does a type mapping lookup based on the CLR type (JsonElement), retrieving the owned JSON type mapping rather than the non-owned one.
In order to find the provider's JsonTypeMapping, our code currently does a standard lookup with CLR type JsonElement (as a sort of special value). The problem is that some provider's actually do support JsonElement as a real property CLR type; in addition, if a user defines a JsonElement property on some entity type, this type mapping will be return, and things will likely fail in some unpredictable way.
We should find another way to look up the JsonTypeMapping, e.g. define some special CLR type instead of JsonElement that could be used, or introduce a new API or something.
/cc @maumar
The text was updated successfully, but these errors were encountered: