Support JSON properties with TPT/TPC inheritance mapping
Currently only TPH inheritance is supported.
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.
Is there any progress related to this?
Is there any progress related to this?
This issue is currently in the backlog, though we hope to be able to tackle this for 9.0. Please don't post "any progress" messages - that mostly spams the issue, taking up our time in looking at the message and responding to it.
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
any traction on this?
Just faced the issue today. Hoping to see this implemented soon!
Our team ran into this limitation with a TPT configuration today as well.
I ran into this today in Nov 2025. I didn't see this limitation anywhere when we build infrastructure. Now when I want to use the json column when we need to, it turns out we can't. I'm unable to describe how mad I am.
@pgolinski see this workaround: https://github.com/dotnet/efcore/issues/28443#issuecomment-2027749257