Exemple #1
0
 internal static TypeUsage ValidateNavigate(
     DbExpression navigateFrom,
     RelationshipEndMember fromEnd,
     RelationshipEndMember toEnd,
     out RelationshipType relType,
     bool allowAllRelationshipsInSameTypeHierarchy)
 {
     ArgumentValidation.CheckMember((EdmMember)fromEnd, nameof(fromEnd));
     ArgumentValidation.CheckMember((EdmMember)toEnd, nameof(toEnd));
     relType = fromEnd.DeclaringType as RelationshipType;
     ArgumentValidation.CheckType((EdmType)relType);
     if (!relType.Equals((object)toEnd.DeclaringType))
     {
         throw new ArgumentException(Strings.Cqt_Factory_IncompatibleRelationEnds, nameof(toEnd));
     }
     ArgumentValidation.RequireCompatibleType(navigateFrom, fromEnd, allowAllRelationshipsInSameTypeHierarchy);
     return(ArgumentValidation.CreateResultType(toEnd));
 }