title: Calling methods inside if() - C#
body: <p>I have a couple of methods that return a bool depending on their success, is there anything wrong with calling those methods inside of the IF() ?</p>
  
  <pre><code>//&amp;&amp; makes sure that Method2() will only get called if Method1() returned true, use &amp; to call both methods
  if(Method1() &amp;&amp; Method2())
  {
      // do stuff if both methods returned TRUE
  }
  </code></pre>
  
  <p>Method2() doesn't need to fire if Method1() returns FALSE.</p>
  
  <p>Let me know there's any problem with the code above.</p>
  
  <p>thank you.</p>
  
  <p><strong>EDIT:</strong> since there was nothing wrong with the code, I'll accept the most informative answer ... added the comment to solve the "newbie &amp; &amp;&amp;" issue</p>