title: Find Min and Max value in table between given variable in C#
body: <p>I have the following database table:</p>
  
  <pre><code>COL-A COL-B
  1     $200
  2     $100
  4     $50
  5     $40 
  </code></pre>
  
  <p>What i need to do is if i have the value <strong>1.5</strong>, i need to find the two numbers that fall between it, so that would be <strong>1</strong> and <strong>2</strong>.</p>
  
  <p>I need the values to input into a linear equation for a pricing calculator that i am working on.</p>
  
  <p>The values may not always be the same, so it could even be like so:</p>
  
  <pre><code>COL-A COL-B
      1     $200
      6     $100
      11     $50
      22     $40 
  </code></pre>
  
  <p>If i had <strong>9</strong>, i would then to return both <strong>6</strong> and <strong>11</strong> as <strong>9</strong> falls between those two values, etc etc</p>
  
  <p>Visualising this i would need them put into seperate variables:</p>
  
  <pre><code>double Min = the_lowest_value;
  double Max = the_highest_value;
  </code></pre>
  
  <p>I am using EF to do this, so it would need to be in LINQ.</p>