I have three tables named as
1. SubProcedure
2. UnitReference
3. TestReference
Here i am having the following conditions
A Subprocedure should have atleast one UnitReference
A SubProcedure Can have Zero or Many TestReferences
A TestReference should have SubProcedure and UnitReference
TestRefernce Table Records Will be like this
Here's an TestRefenceTable Image link to TestReferences.
And My Existing Entity Model Diagram link is ExistingModel.
I am not able to post my image here so that i have added reference link for the diagram .
My Questions is
How can i represent relation between SubProcedure => UnitReference .
How can i represent relation between UnitReference => TestReference .
How can i represent relation between SubProcedure => TestReference ..
I want to ensure my existing relationship between three tables is correct , If its wrong means please guide me to correct it .
Thanks in Advance
Your model looks fine, and does what you want it to; specifically:
UnitReferencecan have manySubProceduresSubProcedurecan have manyTestReferencesUnitReferencecan have manyTestReferencesIf that is what you want then you have done it correctly.
One thing I would note though is that you have redundancy in your model. You can navigate from
UnitReferencetoTestReferencevia two different paths: directly, or viaSubProcedure. This means that one of these relationships is redundant. Let me explain using LINQ method syntax:There is nothing wrong with having redundancy - it can be quite useful. Just be aware that you have two separate relationships to maintain in the case of an update. For example, if you wanted to move a
TestReferencefrom oneSubProcedureto another, you need to update the.SubProcedureproperty of theTestReference, but also the.UnitReferenceproperty to the.UnitReferenceproperty of the newSubProcedure, or the data will be inconsistent.