コード例 #1
0
 private void MapAliases(Expression a, Expression b)
 {
     TableAlias[] prodA = DeclaredAliasGatherer.Gather(a).ToArray();
     TableAlias[] prodB = DeclaredAliasGatherer.Gather(b).ToArray();
     for (int i = 0, n = prodA.Length; i < n; i++)
     {
         aliasScope.Add(prodA[i], prodB[i]);
     }
 }
コード例 #2
0
        protected virtual bool CompareProjection(ProjectionExpression a, ProjectionExpression b)
        {
            if (!Compare(a.Source, b.Source))
            {
                return(false);
            }

            var save = aliasScope;

            try
            {
                aliasScope = new ScopedDictionary <TableAlias, TableAlias>(aliasScope);
                aliasScope.Add(a.Source.Alias, b.Source.Alias);

                return(Compare(a.Projector, b.Projector) &&
                       Compare(a.Aggregator, b.Aggregator) &&
                       a.IsSingleton == b.IsSingleton);
            }
            finally
            {
                aliasScope = save;
            }
        }