src/Shared/EntityFramework/Core/Common/EntitySql/SemanticResolver.cs
// <summary>
// Try resolving multipart identifier as an alternative name of a group key (see SemanticAnalyzer.ProcessGroupByClause(...) for more info).
// </summary>
Try resolving multipart identifier as an alternative name of a group key  for more info).
Try resolving multipart identifier as an alternative name of a group key for more info ) .
internal bool TryResolveDotExprAsGroupKeyAlternativeName(DotExpr dotExpr, out ValueExpression groupKeyResolution)
        {
            groupKeyResolution = null;
            string[] names;
            ScopeEntry scopeEntry;
            int scopeIndex;
            if (IsInAnyGroupScope()
                &&
                dotExpr.IsMultipartIdentifier(out names)
                &&
                TryScopeLookup(TypeResolver.GetFullName(names), out scopeEntry, out scopeIndex))
            {
                var iGetAlternativeName = scopeEntry as IGetAlternativeName;
                 Accept only if names[] match alternative name part by part.
                if (iGetAlternativeName != null
                    && iGetAlternativeName.AlternativeName != null
                    &&
                    names.SequenceEqual(iGetAlternativeName.AlternativeName, NameComparer))
                {
                     Set correlation flag
                    SetScopeRegionCorrelationFlag(scopeIndex);
                    groupKeyResolution =
                        new ValueExpression(
                            GetExpressionFromScopeEntry(scopeEntry, scopeIndex, TypeResolver.GetFullName(names), dotExpr.ErrCtx));
                    return true;
                }
            }
            return false;
        }
internal bool TryResolveDotExprAsGroupKeyAlternativeName ( DotExpr dotExpr , out ValueExpression groupKeyResolution ) { groupKeyResolution = null ; string [ ] names ; ScopeEntry scopeEntry ; int scopeIndex ; if ( IsInAnyGroupScope ( ) && dotExpr . IsMultipartIdentifier ( out names ) && TryScopeLookup ( TypeResolver . GetFullName ( names ) , out scopeEntry , out scopeIndex ) ) { var iGetAlternativeName = scopeEntry as IGetAlternativeName ; if ( iGetAlternativeName != null && iGetAlternativeName . AlternativeName != null && names . SequenceEqual ( iGetAlternativeName . AlternativeName , NameComparer ) ) { SetScopeRegionCorrelationFlag ( scopeIndex ) ; groupKeyResolution = new ValueExpression ( GetExpressionFromScopeEntry ( scopeEntry , scopeIndex , TypeResolver . GetFullName ( names ) , dotExpr . ErrCtx ) ) ; return true ; } } return false ; }
Try resolving multipart identifier as an alternative name of a group key (see SemanticAnalyzer.ProcessGroupByClause(...) for more info).
Try resolving multipart identifier as an alternative name of a group key ( see SemanticAnalyzer . ProcessGroupByClause ( ... ) for more info ) .
// // Accept only if names[] match alternative name part by part. // // // Set correlation flag //
dotExpr
DotExpr
ValueExpression
out