❔ Setting up a One-To-Many-Relationship in EntityFramework Core
I want to establish a relation between Providers and City. 😉 Thanks.
11 Replies
what do I have to do?
Just reference one from the other
Is it one provider per city or vise versa?
It should look pretty similar to the
Events
propertyHere's a simple one-to-many
one city has many providers
Then add a list of providers to the city
And a city to a provider
how does it work ?
What do you mean?
It just does
EF picks up on the relationship you created, generates the appropriate SQL to execute, and executes it when you apply the migration
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.