Good morning,
I am studying the FrameWork Entity Code First and am wondering how I should create a NxN template with extra information in the relationship table. For example:
Let's assume the following relationship (image taken from the MSDN website)
Sofarsogood,IcreatethePersonandCoursetemplateandestablishtherelationshipbetweenthemwiththeICollectionand"telling" that a Course has several Person and vice versa and EF creates this relationship (CourseInstructo).
Now let's assume you need some extra information in the CourseInstruct table, for example Active or StartDate. In the proposed way the EF creates the table automatically not allowing me to add extra field in the relationship, right?
How should I proceed in this case? You should create 3 templates:
- Person
- Course
- CourseInstructo
and establish the relationship of Person and Course with CourseInstructo? How would the sketch of this code and then the manipulation of these records (INSERT, UPDATE, DELETE) be? Thank you.