Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Entity Framework Core Hidden Gems

Entity Framework Core Hidden Gems

These slides accompany my talk "Entity Framework Core Hidden Gems." The code samples, talk videos, and additional resources are available on GitHub: https://github.com/ironcev-talks/entity-framework-core-hidden-gems.

Basic Entity Framework Core features are, I guess, well-known to you. Plain mapping of objects to underlying database tables is straightforward and easy to use.

But EF Core has much more power to offer. My consultancy practice tells me that this power is often neither recognized nor known to developers.

In this talk, I share with you certain lesser-known EF Core features that I would expect to see more often in real-life code. They replace cumbersome hand-made "solutions" with robust alternatives that are easy to implement and maintain.

Through examples that depict real-life cases that I've seen, I'll demonstrate features that will help you to:
- gain more performance out of your queries.
- smoothly work with legacy databases.
- obtain readable diagnostic logs.
- fight anemic domain models.

You will leave the talk with two things under your belt - a set of powerful EF Core features and a clear understanding of how to put them into practice in your projects.


Igor Rončević

March 31, 2020


  1. Entity Framework Core Hidden Gems v0.8.0 @ironcev_ https://unsplash.com/photos/51j9zGKT074

  2. @ironcev_ Kvaliteta EF Core mi je malo pod upitnikom s

    obzirom da temeljne stvari poput svih inheritance strategija uopće nisu podržane (samo TPH).* * I doubt the quality of EF Core, seeing that essential things like all inheritance strategies are not supported at all (only TPH).
  3. @ironcev_

  4. https://unsplash.com/photos/1kZzV02D2hM @ironcev_

  5. https://pixabay.com/en/superhero-girl-speed-runner-534120 @ironcev_

  6. #1 AsNoTracking() @ironcev_

  7. @ironcev_

  8. @ironcev_

  9. @ironcev_

  10. https://blog.staticvoid.co.nz/2012/entity_framework_and_asnotracking @ironcev_ Cum grano salis!

  11. https://unsplash.com/photos/O88J7BqvrzM @ironcev_

  12. #2 Keyless Entity Types @ironcev_

  13. @ironcev_

  14. #3 Defining Queries @ironcev_

  15. @ironcev_

  16. #4 Value Conversions @ironcev_

  17. @ironcev_

  18. @ironcev_

  19. https://unsplash.com/photos/yo01Z-9HQAw @ironcev_

  20. #5 Query Tags @ironcev_

  21. @ironcev_

  22. https://en.wikipedia.org/wiki/Anemia#/media/File:Iron_deficiency_anemia_blood_film.jpg @ironcev_

  23. https://en.wikipedia.org/wiki/Anemia#/media/File:Iron_deficiency_anemia_blood_film.jpg @ironcev_ https://ru.bmstu.wiki/Файл:Martin-Fowler.jpg The catch comes when you look at

    the behavior, and you realize that there is hardly any behavior on these objects, making them little more than bags of getters and setters. I don't know why this anti-pattern is so common. Some technologies encourage it […] Martin Fowler, Anemic Domain Model (https://martinfowler.com/bliki/AnemicDomainModel.html)
  24. #6 Entity Constructors @ironcev_

  25. @ironcev_

  26. @ironcev_

  27. @ironcev_

  28. #7 Backing Fields @ironcev_

  29. @ironcev_

  30. @ironcev_

  31. @ironcev_

  32. Jon P Smith thereformedprogrammer.net Pawel Gerr thinktecture.com/pawel-gerr Gunnar Peipman gunnarpeipman.com

    Julie Lerman pluralsight.com/authors/julie-lerman @ironcev_
  33. @ironcev_ https://unsplash.com/photos/Ev1XqeVL2wI erience ertise Trainings // Architectural Patterns // Working

    with Legacy Databases // Performance Tuning // Developing Database Agnostic Applications
  34. @ironcev_

  35. @ironcev_ Igor Rončević aka ironcev ironcev@hotmail.com github.com/ironcev twitter.com/ironcev_ linkedin.com/in/ironcev sessionize.com/ironcev

    slideshare.net/roncevi speakerdeck.com/ironcev http://thp.im
  36. @ironcev_