I would kindly ask for some help in creating classes that are based on Database diagrams. I am writing my code in C#. And my main doubt is how to create references from one class to another so that it matches my Database diagrams.
For example, in my Database I have 2 initial tables: Screenplay
and ScreenplayWriter
. Screenplay
has attributes screenplayID, movieID, description
and ScreenPlayWriter
has attributes ScreenplayWriterID, personID
. Then I have the 3rd table which connects these 2 initial tables and this one is called WritesScreenplay
and this table has attributes screenplayID, screenplayWriterID
.
Now I would want to transcribe those tables into C# classes. I am assuming I only need two initial classes Screenplay
and ScreenplayWriter
and that the 3rd one can be derived only as a reference between those initial two. I don't know how to write these references in code so that it makes sense. Note by, one screenplay can have multiple screenplay writers.
Any help would be greatly appreciated. Regards