当前位置: 首页>>代码示例>>C#>>正文


C# InternalTrees.Command类代码示例

本文整理汇总了C#中System.Data.Query.InternalTrees.Command的典型用法代码示例。如果您正苦于以下问题:C# Command类的具体用法?C# Command怎么用?C# Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Command类属于System.Data.Query.InternalTrees命名空间,在下文中一共展示了Command类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Copy

 internal static Node Copy(Command cmd, Node n, out VarMap varMap)
 {
     OpCopier oc = new OpCopier(cmd);
     Node newNode = oc.CopyNode(n);
     varMap = oc.m_varMap;
     return newNode;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:OpCopier.cs

示例2: ComputeHashValue

 /// <summary>
 /// Compute the hash value for this node
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="n"></param>
 internal override void ComputeHashValue(Command cmd, Node n)
 {
     base.ComputeHashValue(cmd, n);
     m_hashValue = (m_hashValue << 4) ^ GetHashValue(Definitions);
     m_hashValue = (m_hashValue << 4) ^ GetHashValue(Keys.KeyVars);
     return;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:12,代码来源:ExtendedNodeInfo.cs

示例3: GroupAggregateVarComputationTranslator

 /// <summary>
 /// Private constructor 
 /// </summary>
 /// <param name="command"></param>
 /// <param name="groupAggregateVarInfoManager"></param>
 private GroupAggregateVarComputationTranslator(
     Command command,
     GroupAggregateVarInfoManager groupAggregateVarInfoManager)
 {
     _command = command;
     _groupAggregateVarInfoManager = groupAggregateVarInfoManager;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:12,代码来源:GroupAggregateVarComputationTranslator.cs

示例4: Table

        internal Table(Command command, TableMD tableMetadata, int tableId)
        {
            m_tableMetadata = tableMetadata;
            m_columns = Command.CreateVarList();
            m_keys = command.CreateVarVec();
            m_nonnullableColumns = command.CreateVarVec();
            m_tableId = tableId;

            var columnVarMap = new Dictionary<string, ColumnVar>();
            foreach (var c in tableMetadata.Columns)
            {
                var v = command.CreateColumnVar(this, c);
                columnVarMap[c.Name] = v;
                if (!c.IsNullable)
                {
                    m_nonnullableColumns.Set(v);
                }
            }

            foreach (var c in tableMetadata.Keys)
            {
                var v = columnVarMap[c.Name];
                m_keys.Set(v);
            }

            m_referencedColumns = command.CreateVarVec(m_columns);
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:27,代码来源:Table.cs

示例5: Process

        /// <summary>
        /// Produces a list of all GroupAggregateVarInfos, each of which represents a single group aggregate 
        /// and it candidate function aggregates. It also produces a delegate that given a child node returns the parent node
        /// </summary>
        /// <param name="itree"></param>
        /// <param name="tryGetParent"></param>
        /// <returns></returns>
        internal static IEnumerable<GroupAggregateVarInfo> Process(Command itree, out TryGetValue tryGetParent)
        {
            var groupRefComputingVisitor = new GroupAggregateRefComputingVisitor(itree);
            groupRefComputingVisitor.VisitNode(itree.Root);
            tryGetParent = groupRefComputingVisitor._childToParent.TryGetValue;

            return groupRefComputingVisitor._groupAggregateVarInfoManager.GroupAggregateVarInfos;
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:15,代码来源:GroupAggregateRefComputingVisitor.cs

示例6: Copy

 /// <summary>
 /// Equivalent to OpCopier.Copy, only in addition it keeps track of the defining subtrees
 /// of collection vars defined in the subtree rooted at the copy of the input node n.
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="n"></param>
 /// <param name="varMap"></param>
 /// <param name="newCollectionVarDefinitions"></param>
 /// <returns></returns>
 internal static Node Copy(Command cmd, Node n, out VarMap varMap, out Dictionary<Var, Node> newCollectionVarDefinitions)
 {
     var oc = new OpCopierTrackingCollectionVars(cmd);
     var newNode = oc.CopyNode(n);
     varMap = oc.m_varMap;
     newCollectionVarDefinitions = oc.m_newCollectionVarDefinitions;
     return newNode;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:17,代码来源:OpCopierTrackingCollectionVars.cs

示例7: Create

 /// <summary>
 /// Creates a ProviderCommandInfo for the given node. 
 /// This method should be called when the keys and the sort keys are not known ahead of time.
 /// Typically it is used when there is only one command, that is no query factoring is done.
 /// This method also has the option of pulling up keys and sort information. 
 /// </summary>
 /// <param name="command">The owning command, used for creating VarVecs, etc</param>
 /// <param name="node">The root of the sub-command for which a ProviderCommandInfo should be generated</param>
 /// <returns>The resulting ProviderCommandInfo</returns>
 internal static ProviderCommandInfo Create(
     Command command,
     Node node)
 {   
     return Create(
         command, 
         node, 
         new List<ProviderCommandInfo>() //children 
         );
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:19,代码来源:ProviderCommandInfoUtils.cs

示例8: ExtendedNodeInfo

 internal ExtendedNodeInfo(Command cmd)
     : base(cmd)
 {
     m_localDefinitions = cmd.CreateVarVec();
     m_definitions = cmd.CreateVarVec();
     m_nonNullableDefinitions = cmd.CreateVarVec();
     m_nonNullableVisibleDefinitions = cmd.CreateVarVec();
     m_keys = new KeyVec(cmd);
     m_minRows = RowCount.Zero;
     m_maxRows = RowCount.Unbounded;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:11,代码来源:ExtendedNodeInfo.cs

示例9: ComputeHashValue

        /// <summary>
        /// Computes the hash value for this node. The hash value is simply the 
        /// local hash value for this node info added with the hash values of the child 
        /// nodes
        /// </summary>
        /// <param name="cmd">current command</param>
        /// <param name="n">current node</param>
        internal virtual void ComputeHashValue(Command cmd, Node n)
        {
            m_hashValue = 0;
            foreach (var chi in n.Children)
            {
                var chiNodeInfo = cmd.GetNodeInfo(chi);
                m_hashValue ^= chiNodeInfo.HashValue;
            }

            m_hashValue = (m_hashValue << 4) ^ ((int)n.Op.OpType); // include the optype somehow
            // Now compute my local hash value
            m_hashValue = (m_hashValue << 4) ^ GetHashValue(m_externalReferences);
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:20,代码来源:NodeInfo.cs

示例10: Process

 internal static void Process(Command command)
 {
     Node topMostSort;
     if (command.Root.Child0 != null
         && command.Root.Child0.Op.OpType == OpType.Sort)
     {
         topMostSort = command.Root.Child0;
     }
     else
     {
         topMostSort = null;
     }
     var sortRemover = new SortRemover(command, topMostSort);
     command.Root = sortRemover.VisitNode(command.Root);
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:15,代码来源:SortRemover.cs

示例11: Create

        internal static ProviderCommandInfo Create(
            Command command,
            Node node)
        {
            var projectOp = node.Op as PhysicalProjectOp;
            PlanCompiler.Assert(projectOp != null, "Expected root Op to be a physical Project");

            // build up the CQT
            var ctree = CTreeGenerator.Generate(command, node);
            var cqtree = ctree as DbQueryCommandTree;
            PlanCompiler.Assert(cqtree != null, "null query command tree");

            // Get the rowtype for the result cqt
            var collType = TypeHelpers.GetEdmType<md.CollectionType>(cqtree.Query.ResultType);
            PlanCompiler.Assert(md.TypeSemantics.IsRowType(collType.TypeUsage), "command rowtype is not a record");

            // Build up a mapping from Vars to the corresponding output property/column
            var outputVarMap = BuildOutputVarMap(projectOp, collType.TypeUsage);

            return new ProviderCommandInfo(ctree);
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:21,代码来源:ProviderCommandInfoUtils.cs

示例12: GetPushdownPredicate

        /// <summary>
        /// Split up a predicate into 2 parts - the pushdown and the non-pushdown predicate. 
        /// 
        /// If the filter node has no external references *and* the "columns" parameter is null,
        /// then the entire predicate can be pushed down
        /// 
        /// We then compute the set of valid column references - if the "columns" parameter
        /// is non-null, this set is used. Otherwise, we get the definitions of the 
        /// input relop node of the filterOp, and use that.
        /// 
        /// We use this list of valid column references to identify which parts of the filter
        /// predicate can be pushed down - only those parts of the predicate that do not 
        /// reference anything beyond these columns are considered for pushdown. The rest are
        /// stuffed into the nonPushdownPredicate output parameter
        /// 
        /// </summary>
        /// <param name="command">Command object</param>
        /// <param name="filterNode">the FilterOp subtree</param>
        /// <param name="columns">(Optional) List of columns to consider for "pushdown"</param>
        /// <param name="nonPushdownPredicateNode">(output) Part of the predicate that cannot be pushed down</param>
        /// <returns>part of the predicate that can be pushed down</returns>
        private static Node GetPushdownPredicate(Command command, Node filterNode, VarVec columns, out Node nonPushdownPredicateNode)
        {
            var pushdownPredicateNode = filterNode.Child1;
            nonPushdownPredicateNode = null;
            var filterNodeInfo = command.GetExtendedNodeInfo(filterNode);
            if (columns == null
                && filterNodeInfo.ExternalReferences.IsEmpty)
            {
                return pushdownPredicateNode;
            }

            if (columns == null)
            {
                var inputNodeInfo = command.GetExtendedNodeInfo(filterNode.Child0);
                columns = inputNodeInfo.Definitions;
            }

            var predicate = new Predicate(command, pushdownPredicateNode);
            Predicate nonPushdownPredicate;
            predicate = predicate.GetSingleTablePredicates(columns, out nonPushdownPredicate);
            pushdownPredicateNode = predicate.BuildAndTree();
            nonPushdownPredicateNode = nonPushdownPredicate.BuildAndTree();
            return pushdownPredicateNode;
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:45,代码来源:FilterOpRules.cs

示例13: RuleProcessingContext

 internal RuleProcessingContext(Command command)
 {
     m_command = command;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:RuleProcessor.cs

示例14: InitializeNodeInfo

 private void InitializeNodeInfo(Command command)
 {
     if (this.Op.IsRelOp || this.Op.IsPhysicalOp)
     {
         m_nodeInfo = new ExtendedNodeInfo(command);
     }
     else
     {
         m_nodeInfo = new NodeInfo(command);
     }
     command.RecomputeNodeInfo(this);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:Nodes.cs

示例15: GetExtendedNodeInfo

 /// <summary>
 /// Gets the "extended" nodeinfo for a node; if it has not yet been initialized, then it will be
 /// </summary>
 /// <param name="command">current command object</param>
 /// <returns>extended nodeinfo for this node</returns>
 internal ExtendedNodeInfo GetExtendedNodeInfo(Command command)
 {
     if (m_nodeInfo == null)
     {
         InitializeNodeInfo(command);
     }
     ExtendedNodeInfo extendedNodeInfo = m_nodeInfo as ExtendedNodeInfo;
     Debug.Assert(extendedNodeInfo != null);
     return extendedNodeInfo;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:15,代码来源:Nodes.cs


注:本文中的System.Data.Query.InternalTrees.Command类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。