DDD and EF Core 3: Preserving Encapsulation
This course shows how to build highly encapsulated domain models on one hand and leverage the full power of EF Core on the other.
What you'll learn
Entity Framework has made great progress over the past several years and introduced a lot of features that help you build rich, highly encapsulated domain models. In this course, DDD and EF Core: Preserving Encapsulation, you will learn foundational knowledge of pitfalls and shortcomings to be aware of when applying Domain-driven Design to applications with EF Core. First, you will learn how to preserve encapsulation of your domain models in such applications. Next, you will discover various mapping techniques that will help you to build complex domain models. Finally, you will explore the tips and tricks that will help you navigate around the common ORMs’ issues. When you are finished with this course, you will have the skills and knowledge of Domain-driven Design needed to adhere to DDD principles without compromising on domain model encapsulation.
Table of contents
- Introduction 0m
- DbContext Encapsulation 6m
- Recap: DbContext Encapsulation 2m
- Getting Rid of Public Setters 6m
- Recap: Getting Rid of Public Setters 1m
- Types of Relationships 4m
- Many-to-one Relationships: IDs vs. Navigation Properties 6m
- Refactoring to Navigation Properties 3m
- Recap: Refactoring to Navigation Properties 1m
- Summary 2m
- Introduction 0m
- Eager Loading of Relationships 4m
- Lazy Loading of Relationships 3m
- Refactoring to Lazy Loading 3m
- Recap: Refactoring to Lazy Loading 2m
- The Identity Map Pattern 3m
- The Identity Map Pattern: Referential Equality 2m
- Encapsulating Equality Comparison 3m
- Introducing a Base Entity Class 8m
- Recap: Introducing a Base Entity Class 1m
- Summary 3m
- Introduction 0m
- Introducing a One-to-many Relationship: Part 1 5m
- Introducing a One-to-many Relationship: Part 2 2m
- Recap: Introducing a One-to-many Relationship 2m
- Hiding the Collection Behind a Backing Field 4m
- Recap: Hiding the Collection Behind a Backing Field 2m
- Introducing a Collection Invariant 8m
- Recap: Introducing a Collection Invariant 5m
- Deleting an Item from the Collection 2m
- Recap: Deleting an Item from the Collection 1m
- Shortcomings of Mapping to Backing Fields in EF Core 3m
- Summary 3m
- Introduction 0m
- New Use Case: Registering a Student 3m
- Recap: Registering a Student 5m
- Update and Attach Methods in DbSet 6m
- Recap: Add vs. Update vs. Attach Methods in DbSet 3m
- Assigning a Disconnected Entity to a Connected One 6m
- Recap: Assigning a Disconnected Entity to a Connected One 1m
- Summary 2m