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:
UnitReference
can have manySubProcedure
sSubProcedure
can have manyTestReference
sUnitReference
can have manyTestReference
sIf 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
UnitReference
toTestReference
via 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
TestReference
from oneSubProcedure
to another, you need to update the.SubProcedure
property of theTestReference
, but also the.UnitReference
property to the.UnitReference
property of the newSubProcedure
, or the data will be inconsistent.