https://github.com/pawelgerr/entityframeworkcore-demos
https://github.com/pawelgerr/entityframeworkcore-demos
dotnet-core entity-framework-core performance tph tpt
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pawelgerr/entityframeworkcore-demos
- Owner: PawelGerr
- Created: 2018-04-13T06:39:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-23T15:20:15.000Z (over 6 years ago)
- Last Synced: 2026-03-27T23:42:00.707Z (3 months ago)
- Topics: dotnet-core, entity-framework-core, performance, tph, tpt
- Language: C#
- Size: 97.7 KB
- Stars: 34
- Watchers: 6
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demos for blog posts abount Entity Framework Core
## N+1 Queries Problem
See the method `ExecuteDemoDbQueries` in `Program.cs`
Blog posts:
* [Entity Framework Core Performance: Beware of N+1 Queries](http://weblogs.thinktecture.com/pawel/2018/04/entity-framework-core-performance-beware-of-n1-queries.html)
* [Entity Framework Core 2.1 Performance: Beware of N+1 Queries (Revisited)](http://weblogs.thinktecture.com/pawel/2018/05/entity-framework-core-21-performance-beware-of-n1-queries.html)
## Inheritance
Blog posts:
* [Entity Framework Core: Inheritance - Table-per-Type (TPT) is not supported, is it? (Part 1 - Code First)](http://weblogs.thinktecture.com/pawel/2018/05/entity-framework-core-inheritance-tpt-is-not-supported-is-it-part-1-code-first.html)
* [Entity Framework Core: Inheritance - Table-per-Type (TPT) is not supported, is it? (Part 2 - Database First)](http://weblogs.thinktecture.com/pawel/2018/05/entity-framework-core-inheritance-table-per-type-tpt-is-not-supported-is-it-part-2-database-first.html)
### Table-Per-Hierarchy (TPH)
**Code First**: see the method `ExecuteTphQueries` in `Program.cs` and the file in `/src/EntityFramework.Demo/TphModel/CodeFirst`
### Table-Per-Type (TPT)
**Code First**: see the method `ExecuteTptQueries` in `Program.cs` and the file in `/src/EntityFramework.Demo/TptModel/CodeFirst`
## Changing Schema at Runtime
See the method `ExecuteSchemaChangeQueries` in `Program.cs`
Blog posts:
* [Entity Framework Core: Changing Database Schema at Runtime](http://weblogs.thinktecture.com/pawel/2018/06/entity-framework-core-changing-database-schema-at-runtime.html )
* [Entity Framework Core: Changing DB Migration Schema at Runtime](http://weblogs.thinktecture.com/pawel/2018/06/entity-framework-core-changing-db-migration-schema-at-runtime.html)
## Issues with TransactionScopes
See the method `ExecuteTransactionScopeDemosAsync` in `Program.cs`
Blog posts: [Entity Framework Core: Use TransactionScope with Caution!](http://weblogs.thinktecture.com/pawel/2018/06/entity-framework-core-use-transactionscope-with-caution.html)
## Integration Testing
See code inside folder `IntegrationTests`
Blog posts: [Entity Framework Core: Isolation of Integration Tests](http://weblogs.thinktecture.com/pawel/2018/06/entity-framework-core-isolation-of-integration-tests.html)
## Issues with RowVersion/Timestamp and NumberToBytesConverter
See method `ExecuteRowVersionConversionDemos` in `Program.cs`
Doing a LEFT JOIN with entities having a `RowVersion` on the right side may throw if using `NumberToBytesConverter`.