src/Shared/EntityFramework/Core/Common/EntitySql/SemanticResolver.cs
// <summary>
// Enters a new scope region.
// </summary>
Enters a new scope region.
Enters a new scope region .
internal IDisposable EnterScopeRegion()
        {
             Push new scope (the first scope in the new scope region)
            _scopeManager.EnterScope();
             Create new scope region and push it
            var scopeRegion = new ScopeRegion(_scopeManager, CurrentScopeIndex, _scopeRegions.Count);
            _scopeRegions.Add(scopeRegion);
             Return scope region disposer that rolls back the scope.
            return new Disposer(
                delegate
                    {
                        Debug.Assert(CurrentScopeRegion == scopeRegion, "Scope region stack is corrupted.");
                         Root scope region is permanent.
                        Debug.Assert(_scopeRegions.Count > 1, "_scopeRegionFlags.Count > 1");
                         Reset aggregate info of AST nodes of aggregates resolved to the CurrentScopeRegion.
                        CurrentScopeRegion.GroupAggregateInfos.Each(groupAggregateInfo => groupAggregateInfo.DetachFromAstNode());
                         Rollback scopes of the region.
                        CurrentScopeRegion.RollbackAllScopes();
                         Remove the scope region.
                        _scopeRegions.Remove(CurrentScopeRegion);
                    });
        }
internal IDisposable EnterScopeRegion ( ) { _scopeManager . EnterScope ( ) ; var scopeRegion = new ScopeRegion ( _scopeManager , CurrentScopeIndex , _scopeRegions . Count ) ; _scopeRegions . Add ( scopeRegion ) ; return new Disposer ( delegate { Debug . Assert ( CurrentScopeRegion == scopeRegion , " " ) ; Debug . Assert ( _scopeRegions . Count > 1 , " " ) ; CurrentScopeRegion . GroupAggregateInfos . Each ( groupAggregateInfo => groupAggregateInfo . DetachFromAstNode ( ) ) ; CurrentScopeRegion . RollbackAllScopes ( ) ; _scopeRegions . Remove ( CurrentScopeRegion ) ; } ) ; }
Enters a new scope region.
Enters a new scope region .
// // Push new scope (the first scope in the new scope region) // // // Create new scope region and push it // // // Return scope region disposer that rolls back the scope. // // // Root scope region is permanent. // // // Reset aggregate info of AST nodes of aggregates resolved to the CurrentScopeRegion. // // // Rollback scopes of the region. // // // Remove the scope region. //