I have a simple schema similar to this:
Customer
CustomerId, FirstName, LastName, CreateDt
CustomerFeedback
CustomerFeedbackId, CustomerId, Feedback
There is a foreign key relationship between the two.
- I create a LINQ to SQL model from this, and a relationship line is drawn between the two tables.
- I create an Entity Framework model from this, and no relationship is drawn between the tables.
I've created other schemas and the relationships are automatically drawn. I can't see why it's not working here. My schema is more complicated than this, but I'm only trying to add these two tables. There is definitely a foreign key established because when I create a database diagram in enterprise manager and add the tables the relationship is shown.
How does EF decide when to automatically create relationships?
I can manually create it, but i really hate doing that in case I mess it up. I've restarted Visual studio and started from a completely empty model and it's still doing it.