Entity Framework playground

Explore what happens under the hood when writing queries or using migrations.



Understanding generated code

Entity Framework Core builds database model based on the C# code customized with annotations and conventions. In order to see the generated SQL, the code must be run. You can use this playground to inspect generated SQL structure for both migrations and queries.

Checking migrations output

Entity Framework Core uses entity classes and conventions to build a model. A SQL provider (e.g. SQL Server, SQLite, PostgreSQL) will generate a SQL schema for the associate database. Understanding what will be the output requires extensive experience or inspecting generated code after applying migrations.

Explore migrations with SQL providers

Viewing generated SQL for queries

Entity framework supports querying data using LINQ or LINQ to objects. In both cases the generated SQL can only be seen when running the code. Using the playground, a generated SQL can be inspected given a model and an example query.

Explore generated SQL for queries