Good evening. I have a question again on the Entity Framework

Suppose I have two classes of which ORM should create two tables in the database. In this case, one of the tables must have a foreign key that refers to the first table. How to implement it? I know that there is an attribute ForeignKey but I do not understand how it works - it only has a name? but how to set which field in which table it refers to?

    1 answer 1

    On Habré laid out a series of articles on Code First. If I understand you correctly, look at the first article in the series.