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


C# Command.CreateConditionalOp方法代码示例

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


在下文中一共展示了Command.CreateConditionalOp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CombinePredicates

        // <summary>
        // Combine two predicates by trying to avoid the predicate parts of the
        // second one that are already present in the first one.
        // In particular, given two nodes, predicate1 and predicate2,
        // it creates a combined predicate logically equivalent to
        // predicate1 AND predicate2,
        // but it does not include any AND parts of predicate2 that are present
        // in predicate1.
        // </summary>
        internal static Node CombinePredicates(Node predicate1, Node predicate2, Command command)
        {
            var andParts1 = BreakIntoAndParts(predicate1);
            var andParts2 = BreakIntoAndParts(predicate2);

            var result = predicate1;

            foreach (var predicatePart2 in andParts2)
            {
                var foundMatch = false;
                foreach (var predicatePart1 in andParts1)
                {
                    if (predicatePart1.IsEquivalent(predicatePart2))
                    {
                        foundMatch = true;
                        break;
                    }
                }
                if (!foundMatch)
                {
                    result = command.CreateNode(command.CreateConditionalOp(OpType.And), result, predicatePart2);
                }
            }
            return result;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:34,代码来源:PlanCompilerUtil.cs


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