2024-03-21

Livestream – Chris Klug: Stop using Entity Framework as a DTO provider!

Chris Klug has some opinions about Entity Framework and wants you to know about them…

Entity Framework is a great tool to retrieve your data from databases. However, it can also be a bit complicated and requires that you read a bit more than just the “Getting Started with EF” page. Unfortunately, this seems to be what most developers do.

I think that is why I keep seeing people using it to replicate the database structure in their code with DTOs. This is not the way it was intended to be used – it was intended to persist and retrieve data for your C# objects, not just DTOs.

And if one more person tells me, “We used a micro-ORM for this project since it does the same thing as EF but without the complexity”, I’ll blow a gasket!

Join me for a look into how we can do better. In this talk, I will show you how we can use proper OOP and still use EF to persist and retrieve our objects.

Agenda

00:00:00 – Introduction

00:02:37 – Presentation Start

00:11:38 – The Example Domain

00:21:08 – But Why? EF is an ORM

00:24:17 – Demo Code

01:02:23 – Running the Sample and Fixes

01:08:00 – Wrap up

01:15:41 – Q&A

Nästa

BankID inför Säker Start som krav från Maj 2024 - Är ditt företag redo?