✅ EF Seeding and Relationships
Hey everyone, I have a quick question. I'm reading through the EF documentation rn because I need to do seeding on my project.
It got me a little confused... I have a many to many relationship between a class Person and Film, and I need to do their relation in the objects I'm creating through seeding, but I got a little lost on how to do it because all examples change a part of my code that is needed to create the relation between these objects in the first place (on first image). Is anyone familiar with this to help me?
Code Example that changed stuff is on the 2nd pic.
If I follow this examples, will the relationships remain the same (and working)?
This is the link I was reading from:
https://learn.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-key%2Csimple-key#joining-relationships-configuration
I'll send some photos of my code too (idk how you guys do to post code on text here).
Relationships - EF Core
How to configure relationships between entity types when using Entity Framework Core
3 Replies
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/tks
"""""solved"""" it by manually writing part of the migration. Couldn't find how to do it in a way that wasn't this.