예제 #1
0
        public void EdmPathExpressionWithInvalidNonInheritedTypeCastSegmentShouldError()
        {
            EdmEntityType entityType      = new EdmEntityType("ds.s", "entityType");
            EdmEntityType otherEntityType = new EdmEntityType("ds.s", "otherEntityType");
            EdmModel      model           = new EdmModel();

            model.AddElement(entityType);
            model.AddElement(otherEntityType);

            EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(entityType, true), true /*isBound*/, new EdmPathExpression("bindingEntity/ds.s.otherEntityType"), false);

            function.AddParameter("bindingEntity", new EdmEntityTypeReference(entityType, false));
            model.AddElement(function);

            ValidateErrorInList(
                model,
                function,
                EdmErrorCode.InvalidPathInvalidTypeCastSegment,
                Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment("EntitySetPath", "bindingEntity/ds.s.otherEntityType", entityType.FullName(), otherEntityType.FullName()));
        }