src/Shared/EntityFramework/Internal/RetryAction`.cs
// <summary>
// Performs the action unless it has already been successfully performed before.
// </summary>
// <param name="input"> The input to the action; ignored if the action has already succeeded. </param>
Performs the action unless it has already been successfully performed before.
Performs the action unless it has already been successfully performed before .
[DebuggerStepThrough]
        public void PerformAction(TInput input)
        {
            lock (_lock)
            {
                if (_action != null)
                {
                    var action = _action;
                    _action = null;
                    try
                    {
                        action(input);
                    }
                    catch (Exception)
                    {
                        _action = action;
                        throw;
                    }
                }
            }
        }
[ DebuggerStepThrough ] public void PerformAction ( TInput input ) { lock ( _lock ) { if ( _action != null ) { var action = _action ; _action = null ; try { action ( input ) ; } catch ( Exception ) { _action = action ; throw ; } } } }
Performs the action unless it has already been successfully performed before.
Performs the action unless it has already been successfully performed before .
// This code is taken from System.Lazy with the parts of that class that we are not using removed // and with extra logic to allow initialization retry. // Note that if the same thread attempts to perform the action again (such as when // an initializer creates a new context instance while initializing) then the second // run through this code will do nothing because _action will be null. // Reset the action so that it will be re-tried.
input
TInput
The input to the action; ignored if the action has already succeeded.
The input to the action ; ignored if the action has already succeeded .