EF mapping strategies for the derived types

Have you ever wondered how EF maps inheritance hierarchies to database tables?

When working with inheritance in your domain model, Entity Framework Core must decide how to represent that hierarchy in the database. Although the class structure may look simple, EF Core has multiple strategies for mapping derived types, and each one has significant performance and storage implications.

By default, EF Core uses Table-Per-Hierarchy (TPH), but newer versions also support Table-Per-Type (TPT) and Table-Per-Concrete-Type (TPC). Choosing between them is not just a design decision—it affects query performance, insert/update costs, schema complexity, and scalability.

Vahid Arya
30 0
High-Efficiency Bulk Data Techniques for EF Core

A bulk operation refers to the process of inserting, updating, or deleting a large number of records in a database in a single, optimized command or batch, rather than executing individual statements for each row.

This is critically important for performance in data-intensive applications(e.g. as ETL processes, migrations, or real-time analytics) because it reduces network latency, minimizes transaction log overhead, and can improve throughput by 10x to 100x compared to row-by-row operations.

 

So now that we understand the importance of the topic, let's take a look at ef's support for bulk operations and see if functions like AddRange() and RemoveRange() are considered bulk operations or not.

Vahid Arya
52 0
Stay in touch with us.

(+98)9192962583

info@redmask.ir

paint-brush
Follow Me

© vahid arya. All Rights Reserved.