Default constructors required for EF #959
Answered
by
ardalis
renetitulaer
asked this question in
Q&A
-
If I look to the example of contributor, I don't see a default constructor. From DDD point of view this is what you want but EF will then not be able to create contributors when loading data. |
Beta Was this translation helpful? Give feedback.
Answered by
ardalis
Aug 8, 2025
Replies: 1 comment
-
If you mean this class: It has a constructor that takes in a name and EF core can use that (by virtue of the converter that Vogen generates as part of the name value object). |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
renetitulaer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you mean this class:
https://github.com/ardalis/CleanArchitecture/blob/main/sample/src/NimblePros.SampleToDo.Core/ContributorAggregate/Contributor.cs
It has a constructor that takes in a name and EF core can use that (by virtue of the converter that Vogen generates as part of the name value object).