How to in case of timeout to execute method again and again until it completes successfully?
<p>I have asp.net application. All business logic in business layer.</p>

<p>Here is the example of the method</p>

<pre><code>public void DoSomething()
{
        PersonClass pc = new PersonClass();

        pc.CreatePerson();
        pc.AssignBasicTask();
        pc.ChangePersonsStatus();
        pc.CreateDefaultSettings();    
}
</code></pre>

<p>what happens once in a while, one of the sub method can timeout, so as a result the process can be incompleted.</p>

<p>what I think in this case to make sure all steps completed properly is </p>

<pre><code>public void DoSomething()
    {
            PersonClass pc = new PersonClass();
            var error = null;

            error =  pc.CreatePerson();

            if(error != timeout exception)                  
             error = pc.AssignBasicTask();
            else
              return to step above

            if(error != timeout exception)
              error = pc.ChangePersonsStatus();
            else
              return to step above

            if(error != timeout exception)
              error = pc.CreateDefaultSettings();
            else
              return to step above    
    }
</code></pre>

<p>but it's just an idea, more then sure it's a proper way how to handle this.</p>
