title: How to write recursion on loop properly?
body: <p>I have such <code>List&lt;IRequest&gt;</code></p>
  <pre><code>public interface IRequest
      {
          List&lt;IRequest&gt; Childrens { get; set; }
          bool RequestIsSelected { get; set; }
      }
  </code></pre>
  <p>How to find <code>RequestIsSelected</code> object?</p>
  <p>Let's say I have such structure</p>
  <pre><code>IRequest -
            |
            IRequest - 
                      |
                       IRequest  &lt;--- if this one is true I can catch it
            |
            IRequest -
                      |
                       IRequest   &lt;----- This one RequestIsSelected == true;  (I can't catch it)
  </code></pre>
  <p>I wrote such method</p>
  <pre><code>private IRequest GetSelectedItem(List&lt;IRequest&gt; entireList)
          {
              foreach(var tmp in entireList)
              {
                  if(tmp.RequestIsSelected)
                  {
                      return tmp;
                  }
                  else
                  {
                      return GetSelectedItem(tmp.Childrens);
                  }
              }
  
              return null;
          }
  </code></pre>
  <p>But it iterates only on first deep line, if my selected item resides in second line my method returns null.</p>
  <p>What am I doing wrong?</p>