When it comes to DDD, persistence is a big pain point that people discover abruptly. One of the trickiest parts is persisting DDD value objects. The main challenge with DDD value objects is that they don't have identifiers, and therefore persisting them is hacky. And you usually get a lot of EF Core exceptions until you're even able to do a migration. Not anymore! In this video we'll uncover some tips that will make persisting DDD value objects way easier.
✅ Join this channel to get source code access and other perks:
https://www.youtube.com/channel/UCyTPru-1gZ7-4qblcKM0TiQ/join
Contents
1. Intro: 00:00
2. Recap: aggregates and value objects: 01:44
3. First challenge: constructor 07:06
4. Challenges with private setters: 09:10
5. Biggest challenge: missing identifiers 10:17
6. Aggregates and DbSets: 11:09
7. Ef Core owned entity types FTW! 11:46
8. Evaluating the migration: 14:51
9. Persisting new aggregates: 17:12
10. Updating existing aggregates: 22:03
11. Conclusions: 26:48