src/Shared/EntityFramework/Core/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs
// <summary>
// Do all validation for this element here, and delegate to all sub elements
// </summary>
Do all validation for this element here, and delegate to all sub elements
Do all validation for this element here and delegate to all sub elements
internal override void Validate()
        {
            base.Validate();
            if (_relationshipEnd == null
                || _entitySet == null)
            {
                return;
            }
            if (!_relationshipEnd.Type.IsOfType(_entitySet.EntityType)
                &&
                !_entitySet.EntityType.IsOfType(_relationshipEnd.Type))
            {
                AddError(
                    ErrorCode.InvalidEndEntitySet, EdmSchemaErrorSeverity.Error,
                    Strings.InvalidEndEntitySetTypeMismatch(_relationshipEnd.Name));
            }
        }
internal override void Validate ( ) { base . Validate ( ) ; if ( _relationshipEnd == null || _entitySet == null ) { return ; } if ( ! _relationshipEnd . Type . IsOfType ( _entitySet . EntityType ) && ! _entitySet . EntityType . IsOfType ( _relationshipEnd . Type ) ) { AddError ( ErrorCode . InvalidEndEntitySet , EdmSchemaErrorSeverity . Error , Strings . InvalidEndEntitySetTypeMismatch ( _relationshipEnd . Name ) ) ; } }
Do all validation for this element here, and delegate to all sub elements
Do all validation for this element here and delegate to all sub elements
// We need to allow 2 kind of scenarios: // 1> If you have a relationship type defined between Customer and Order, then you can have a association set in  //    which the Customer end refers to a Entity Set of type GoodCustomer where GoodCustomer type derives from Customer // 2> If you have a relationship type defined between GoodCustomer and Order, then you can have a relationship //    set which GoodCustomer end refers to an entity set whose entity type is Customer (where GoodCustomer derives //    from Customer). This scenario enables us to support scenarios where you want specific types in an entity set //    to take part in a relationship.