src/Shared/EntityFramework/Core/Common/EntitySql/ScopeRegion.cs
// <summary>
// Applies <paramref name="action" /> to all scope entries in the current scope region.
// </summary>
Applies  to all scope entries in the current scope region.
Applies to all scope entries in the current scope region .
internal void ApplyToScopeEntries(Func<ScopeEntry, ScopeEntry> action)
        {
            Debug.Assert(FirstScopeIndex <= _scopeManager.CurrentScopeIndex, "FirstScopeIndex <= CurrentScopeIndex");
            for (var i = FirstScopeIndex; i <= _scopeManager.CurrentScopeIndex; ++i)
            {
                var scope = _scopeManager.GetScopeByIndex(i);
                List<KeyValuePair<string, ScopeEntry>> updatedEntries = null;
                foreach (var scopeEntry in scope)
                {
                    var newScopeEntry = action(scopeEntry.Value);
                    Debug.Assert(newScopeEntry != null, "newScopeEntry != null");
                    if (scopeEntry.Value != newScopeEntry)
                    {
                        if (updatedEntries == null)
                        {
                            updatedEntries = new List<KeyValuePair<string, ScopeEntry>>();
                        }
                        updatedEntries.Add(new KeyValuePair<string, ScopeEntry>(scopeEntry.Key, newScopeEntry));
                    }
                }
                if (updatedEntries != null)
                {
                    updatedEntries.Each((updatedScopeEntry) => scope.Replace(updatedScopeEntry.Key, updatedScopeEntry.Value));
                }
            }
        }
internal void ApplyToScopeEntries ( Func < ScopeEntry , ScopeEntry > action ) { Debug . Assert ( FirstScopeIndex <= _scopeManager . CurrentScopeIndex , " " ) ; for ( var i = FirstScopeIndex ; i <= _scopeManager . CurrentScopeIndex ; ++ i ) { var scope = _scopeManager . GetScopeByIndex ( i ) ; List < KeyValuePair < string , ScopeEntry > > updatedEntries = null ; foreach ( var scopeEntry in scope ) { var newScopeEntry = action ( scopeEntry . Value ) ; Debug . Assert ( newScopeEntry != null , " " ) ; if ( scopeEntry . Value != newScopeEntry ) { if ( updatedEntries == null ) { updatedEntries = new List < KeyValuePair < string , ScopeEntry > > ( ) ; } updatedEntries . Add ( new KeyValuePair < string , ScopeEntry > ( scopeEntry . Key , newScopeEntry ) ) ; } } if ( updatedEntries != null ) { updatedEntries . Each ( ( updatedScopeEntry ) => scope . Replace ( updatedScopeEntry . Key , updatedScopeEntry . Value ) ) ; } } }
Applies  to all scope entries in the current scope region.
Applies to all scope entries in the current scope region .
action
Func<ScopeEntry, ScopeEntry>