Ejemplo n.º 1
0
        public object Translate(TranslationContext context, ASTNode node)
        {
            // Reject translation for properties with an explicit scope
            var scope = node.GetAttribute<string>("scope", VerificationContext.Current);

            if (scope != VerificationContext.Current)
            {
                throw new NotSupportedException("Property path cannot be translated because it references an explicit scope, which is not supported in CREF.");
            }

            var sourceType = node.GetAttribute<ObjectType>("sourceType");

            // Translate path information
            return context.TransformModelPath(sourceType, node, node.GetAttribute<string>("path"));
        }