Debugging Multiple Constraint Violations

I get a violation of the plurality constraint in my entity model.

In my entity model, I have two relationship properties:

  • SubstanceTypeMixConstituents
  • Category

SubstanceTypeMixConstituents
 - Multiplicity * (Many)
Category
 - Multiplicity: 1 (One)
 - Foreign key, but not null

enter image description here

How to find the cause of the problem and solve this problem?

System.InvalidOperationException: A relationship multiplicity constraint violation occurred: An EntityReference expected at least one related object, but the query returned no related objects from the data store.
   at System.Data.Objects.DataClasses.EntityReference`1.Load(MergeOption mergeOption)
   at System.Data.Objects.DataClasses.RelatedEnd.DeferredLoad()
   at System.Data.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem](TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject)
   at System.Data.Objects.Internal.LazyLoadBehavior.<>c__DisplayClass7`2.<GetInterceptorDelegate>b__2(TProxy proxy, TItem item)
   at System.Data.Entity.DynamicProxies.SubstanceType_BEE32ACA75386E981F7CA3F6A3C565BC1D8ADACA228C603A2EACC918DCDCBA30.get_Category()
+3
source share
1 answer

, - Category SubstanceTypeMixConstituent, One-to-many - a Category SubstanceTypeMixConstituents, SubstanceTypeMixConstituent ( ) Category ( , ). , , , - Category SubstanceTypeMixConstituents, SubstanceTypeMixConstituent Category.

+2

All Articles