title: How to limit scope of a constant to method/block
body: <p>Is there any way to limit the scope of a compile-time constant to a method/block of code that avoids hardcoding the value? </p>
  
  <p>Something like the following:</p>
  
  <pre><code>public int SomeMethod(int a) {
      const int SomeCompileTimeConstant = 10; // obviously this doesn't exist
  
      return a + SomeCompileTimeConstant;
  }
  </code></pre>
  
  <p>opposed to hardcoding the value:</p>
  
  <pre><code>public int SomeMethod(int a) {              
      return a + 10;
  }
  </code></pre>
  
  <p>or making it a class-level constant:</p>
  
  <pre><code>public class A {
      private const int SomeCompileTimeConstant = 10;
  
      public int SomeMethod(int a) {
          return a + SomeCompileTimeConstant;
      }
  }
  </code></pre>