❔ Ef core creating shadow foreign key, why?
Got this error:
The classes:
Mapping:
Any idea? Cant seem to resolve this
10 Replies
what if you remove the manual config?
and let EF infer by convetion?
Why do that tho?
In addition, could this cause the error?
Those are on the Lesson class, someone put the Class as a single reference and a collection, could it be the root cause?
generally I prefer to let EF infer by convention, only doing fluent when conventions do not suffice
it makes the code easier to understand, and also keeps you from misconfiguring your db by accident
as for the single ref and collection, I'm not sure
I haven't tried a setup like that before
Well after removing said line i get:
So basically gotta go fluent on this
ah rip
you might want to move to #database
EF is something I'm not great on helping with unless it's basic, or I can be more hands on
can you tag some ef core pro here perhaps?
the pros hang out in #database
just ask there
Im thinking those lines are the root cause, just want to confirm before gutting the codebase
Alright
Appreciate your time, have a great day @jcotton42
np
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.