-
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
Support JSON properties with TPT/TPC inheritance mapping #28443
Comments
Hi @maumar, @AndriySvyryd and @ajcvickers . Do we have a timeline for this? |
@mahdishahbazi this is being considered for the 8.0 release, but it may or may not make it in. |
This comment was marked as resolved.
This comment was marked as resolved.
1 similar comment
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The docs for TPC strategy really need to list all these limitations as a big warning! It's quite painful to find out that feature x, y, and z is not supported when using TPC or hierarchies in general, AFTER designing around it. I hope these features exist eventually, but for now guiding users away from the feature when they're just gonna cause themselves pain seems prudent. |
A workaround, or how it has traditionally been done: public class BaseClassConfiguration : IEntityTypeConfiguration<BaseClass>
{
public void Configure(EntityTypeBuilder<BaseClass> builder)
{
builder.UseTpcMappingStrategy();
builder
.Property(b => b.JsonProperty)
.HasConversion(
x => JsonSerializer.Serialize(x, JsonSerializerOptions.Default),
x => JsonSerializer.Deserialize<SomeType>(x, JsonSerializerOptions.Default))
.IsUnicode();
}
} This does mean you can't query and index the JSON values within but at least you can store it. |
Every time I turn around there's another limitation I bumped into |
Currently only TPH inheritance is supported.
The text was updated successfully, but these errors were encountered: