From the course: Practical Application Architecture with Entity Framework Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Data models everywhere

Data models everywhere - Entity Framework Tutorial

From the course: Practical Application Architecture with Entity Framework Core

Start my 1-month free trial

Data models everywhere

- [Instructor] Before the end of the course, I want to spend a little bit of time, discussing mistakes that are often made when building entity framework applications. Many of these items have been touched on earlier in the course, but it's worth fleshing them out separately, so that they can be avoided. In this video, I'm going to talk about limiting the use of entity framework models. Entity framework models can be used as business or domain models, as we have in the demo, but even when taking great care to keep the database out of the models, this isn't always the right way to go. We can get a lot of value out of ensuring all of the entity framework pieces are outside of the model. Rather than use the EF Data Annotations, use the Fluent API to define the data model as part of the data context. Use partial classes with the models to implement interfaces like we did earlier in the course with IValidatableObject. Don't be afraid to continue extending the models with other interfaces…

Contents