private IEdmNavigationProperty ParseSingleConstraint(string property, string referencedProperty, CsdlLocation location = null) { var constraint = new CsdlReferentialConstraint(property, referencedProperty, location); var testSubject = new CsdlSemanticsNavigationProperty(this.semanticEntityType, new CsdlNavigationProperty("Fake", "Fake.Fake", false, "Fake", false, null, new[] { constraint }, null)); return(testSubject); }
public CsdlAssociation(string name, CsdlAssociationEnd end1, CsdlAssociationEnd end2, CsdlReferentialConstraint constraint, CsdlDocumentation documentation, CsdlLocation location) : base(name, documentation, location) { this.end1 = end1; this.end2 = end2; this.constraint = constraint; }
public CsdlSemanticsReferentialConstraint(CsdlSemanticsAssociation context, CsdlReferentialConstraint constraint) : base(constraint) { this.principalCache = new Cache <CsdlSemanticsReferentialConstraint, IEdmAssociationEnd>(); this.dependentPropertiesCache = new Cache <CsdlSemanticsReferentialConstraint, IEnumerable <IEdmStructuralProperty> >(); this.errorsCache = new Cache <CsdlSemanticsReferentialConstraint, IEnumerable <EdmError> >(); this.principalKeyPropertiesNotFoundInPrincipalPropertiesCache = new Cache <CsdlSemanticsReferentialConstraint, IEnumerable <string> >(); this.dependentPropertiesNotFoundInDependentTypeCache = new Cache <CsdlSemanticsReferentialConstraint, IEnumerable <string> >(); this.context = context; this.constraint = constraint; }
public CsdlSemanticsReferentialConstraint(CsdlSemanticsAssociation context, CsdlReferentialConstraint constraint) : base(constraint) { this.context = context; this.constraint = constraint; }
private EdmReferentialConstraintPropertyPair ComputeReferentialConstraintPropertyPair(CsdlReferentialConstraint csdlConstraint) { // <EntityType Name="Product"> // ... // <Property Name="CategoryID" Type="Edm.String" Nullable="false"/> // <NavigationProperty Name="Category" Type="Self.Category" Nullable="false"> // <ReferentialConstraint Property="CategoryID" ReferencedProperty="ID" /> // </NavigationProperty> // </EntityType> // the above CategoryID is DependentProperty, ID is PrincipalProperty. IEdmStructuralProperty dependentProperty = this.declaringType.FindProperty(csdlConstraint.PropertyName) as IEdmStructuralProperty ?? new UnresolvedProperty(this.declaringType, csdlConstraint.PropertyName, csdlConstraint.Location); IEdmStructuralProperty principalProperty = this.TargetEntityType.FindProperty(csdlConstraint.ReferencedPropertyName) as IEdmStructuralProperty ?? new UnresolvedProperty(this.ToEntityType(), csdlConstraint.ReferencedPropertyName, csdlConstraint.Location); return(new EdmReferentialConstraintPropertyPair(dependentProperty, principalProperty)); }