Skip to content

Commit

Permalink
Fix error around mapping Nullable<JsonElement> (#3353)
Browse files Browse the repository at this point in the history
Fixes #2977

(cherry picked from commit b875f5d)
  • Loading branch information
roji committed Nov 6, 2024
1 parent e38ff7b commit 157ea2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, ICo
{
var property = propertyBuilder.Metadata;

if (property.ClrType == typeof(JsonElement) && property.GetColumnType() is null)
if (property.ClrType.UnwrapNullableType() == typeof(JsonElement) && property.GetColumnType() is null)
{
property.SetTypeMapping(_jsonTypeMapping ??= new NpgsqlJsonTypeMapping("jsonb", typeof(JsonElement)));
}
Expand Down

0 comments on commit 157ea2e

Please sign in to comment.