❔ Entity framework core Fluent API
Hi all.
I'm trying to add a migration but I get an error because EF Core can't bound constructor parameter "category" and the property "ProductCategory". I have added the required mapping in "OnModelCreating" inside my DbContext class but it doesn't seem to work. Am I missing something? I don't have any problem with other properties because their name coincide with constructor parameters.
Thank you 🙂
3 Replies
I know that I could rename the parameter name but I want to understand what is the problem here and if it is possible to do this kind of mapping.
For now I have solved adding an empty constructor. It's an anti-pattern so if you have a better idea let me know.
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.