title: How to replace multiple if statements i to more compact code/class in C#?
body: <p>I'm having a problem converting multiple if statements (like in the example below) into more compact code. I though about tables or multidimensional arrays, but maybe you guys know a better solution. I have about 30 if statements in my code and there is no clear pattern in them in order to easily convert that code to something faster and more compact.</p>
  
  <p>How can I improve this?</p>
  
  <pre><code>if (D == 0.25)
  {
      if (threadPerInch == 20)
      {
          le = 0.22;
      }
      else if (threadPerInch == 28)
      {
          le = 0.25;
      }
      else if (threadPerInch == 32)
      {
          le = 0.28;
      }
      else
      {
  
      }
  }
  </code></pre>