private void HandleConstraintElement(XmlReader reader) { ReferentialConstraint referentialConstraint = new ReferentialConstraint(this); referentialConstraint.Parse(reader); this.Constraints.Add(referentialConstraint); if (this.Schema.DataModel != SchemaDataModelOption.EntityDataModel || this.Schema.SchemaVersion < 2.0) { return; } this._isForeignKey = true; }
/// <summary> /// handle the constraint element /// </summary> /// <param name="reader"> XmlReader positioned at the constraint element </param> private void HandleConstraintElement(XmlReader reader) { DebugCheck.NotNull(reader); var constraint = new ReferentialConstraint(this); constraint.Parse(reader); Constraints.Add(constraint); if (Schema.DataModel == SchemaDataModelOption.EntityDataModel && Schema.SchemaVersion >= XmlConstants.EdmVersionForV2) { // in V2, referential constraint implies foreign key _isForeignKey = true; } }