Value cannot be null. Parameter name: constructor
Using Entity Framework I occasionally get the following error when reading from the database -
`exceptionMessage=Value cannot be null. Parameter name: constructor`
Person class looked like this -
There is no way for Entity Framework to know how to instantiate this object because there is no empty constructor.
If you are following some of the principles of domain driven design you may not want a public empty constructor, no problem, make it private.
- Requesting Data from two Data Stores in Sequence - Cache and a Database
- Requesting Data from two Data Stores in Parallel - Cache and Database
- Using Entity Framework for .NET 6 with SQL Server in a Docker Container
- Entity Framework Core and calling a stored procedure
- Entity Framework, checking the connection string of your context