示例#1
0
        private static ReadonlyNodeTypeProvider CreateNodeTypeProvider()
        {
            var methodInfoBasedNodeTypeRegistry = MethodInfoBasedNodeTypeRegistry.CreateFromRemotionLinqAssembly();

            methodInfoBasedNodeTypeRegistry
            .Register(QueryAnnotationExpressionNode.SupportedMethods, typeof(QueryAnnotationExpressionNode));

            methodInfoBasedNodeTypeRegistry
            .Register(IncludeExpressionNode.SupportedMethods, typeof(IncludeExpressionNode));

            methodInfoBasedNodeTypeRegistry
            .Register(ThenIncludeExpressionNode.SupportedMethods, typeof(ThenIncludeExpressionNode));

            var innerProviders
                = new INodeTypeProvider[]
                {
                methodInfoBasedNodeTypeRegistry,
                MethodNameBasedNodeTypeRegistry.CreateFromRemotionLinqAssembly()
                };

            return(new ReadonlyNodeTypeProvider(new CompoundNodeTypeProvider(innerProviders)));
        }