Skip to content

v7.0.2

Latest

Choose a tag to compare

@destbg destbg released this 28 Aug 06:50
· 6 commits to main since this release

Changes from 7.0.1 to 7.0.2

A derived value in a polymorphic JSON column lost its type discriminator on write

A property declared as a polymorphic base type ([JsonPolymorphic] and [JsonDerivedType]) wrote a stored derived value through the runtime type of the value. The JSON then held no type discriminator, so the row read back as the base type and the derived data was lost.

is and as checks on polymorphic JSON columns translate to SQL

Where(r => r.Data is Derived) and bare null checks such as Where(r => r.Data as Derived != null) threw NotSupportedException before. They now compare the stored type discriminator and follow the registered derived types, including derived types of derived types.

Member access through as on a JSON column

Reading a member through the as operator, such as (r.Data as Derived).Value, now translates to json_extract on the member path, the same as the cast form.

Source generator alignment for the new query shapes

Three source generator bugs surfaced by the fixes to the shapes above. Two is projections over different column types shared one generated materializer and crashed with InvalidCastException. A null-valued cast such as (int?)null in a projection and a parenthesized receiver under the null-forgiving operator such as (r.Title as string)!.Length silently skipped materializer generation for the whole query.

Full Changelog: 7.0.1...7.0.2