Skip to main content
All CollectionsLineage
Extracting Lineage from Entity Framework Core (Built-in C# ORM)
Extracting Lineage from Entity Framework Core (Built-in C# ORM)
Updated over a week ago

What is Entity Framework Core?

Entity Framework Core (EF Core) is Microsoft built-in object-relational mapper (ORM) for .NET. It allows developers to work with databases using .NET objects, meaning you can query and update your database using C# code without needing to write SQL queries. EF Core is a lightweight, extensible, and cross-platform version of Entity Framework and is designed to work with a variety of databases, including SQL Server, MySQL, PostgreSQL, and SQLite. It simplifies data access in C# applications and allows developers to focus on application logic rather than database-specific details, making it a popular ORM choice for .NET developers.
For more details on Entity Framework Core, visit the official documentation:

Why Is Entity Framework Core Lineage and Schema Management Crucial?

In many organizations, EF Core is the primary tool used for database interactions in .NET applications, particularly in OLTP environments. These databases often serve as the foundation for broader data pipelines that feed into data warehouses like Snowflake or Azure Synapse using ETL tools such as Fivetran or AirByte. Once the data is in the warehouse, it’s transformed using platforms like dbt or Azure Data Factory and consumed by BI tools such as Power BI or Tableau.

Given the importance of EF Core models in defining the database schema, any change made to these models—such as renaming a column or changing a data type—can have wide-reaching effects throughout the data pipeline. Downstream systems, transformations, and analytics dashboards may be impacted by these changes, making it critical for teams relying on this data to be notified of any potential schema modifications. Early visibility into these changes ensures that teams can adjust their systems proactively and avoid costly data quality issues.

Automated Entity Framework Core Schema Extraction from Code

Foundational’s Code Engine automates the extraction of schema and lineage information directly from EF Core models. This automation enables developers and data teams to identify and assess schema changes during the development phase or in pending Pull Requests (PRs). Early detection of changes provides teams with the opportunity to evaluate downstream impacts before these changes are deployed, helping to avoid disruptions in production environments.

A Unique Approach Compared to Traditional Methods

Sample EF Core Code


While many tools rely on extracting schema information from the database after changes have been applied, Foundational takes a proactive approach by analyzing the EF Core model classes directly from the codebase. This method allows teams to gain visibility into potential schema changes earlier in the development cycle, reducing the risk of downstream breakages in production.

For example, rather than waiting for a migration to be applied to the database, Foundational inspects EF Core model classes and their relationships to extract schema details such as table names, column types, and constraints. By doing so, teams are informed of potential schema changes before they impact downstream systems.

Setup Instructions

Setting up schema and lineage extraction for EF Core models with Foundational is simple. Connect your repository containing the EF Core model classes, and Foundational’s Code Engine will automatically detect and extract the schema details.

Once connected, the Code Engine processes the EF Core models, providing full visibility into the schema and lineage within your data infrastructure—all without needing direct access to your production database.

Did this answer your question?