title: Coding : Using Struct as a DataUtility/Library for Hardcode values (Constants)
body: <p>Is it OK to use Structs as Data library for hardcoded values? Sometimes we can't avoid hardcoding somethin althought it's better to put it on something like xml file or a database table, but sometimes it's not possible for some reasons.</p>
  
  <pre><code> public struct BatchStatus
   {
      public const string Submitted = "0901XX";
      public const string Active = "62783XY";
      public const string Inactive = "S23123";
   }
  </code></pre>
  
  <p>then I use it like this</p>
  
  <pre><code> switch (batchStatus) // enums doesnt work in switch case
  {
       case BatchStatus.Submitted:
           new Batch().Submit(); break;
      case BatchStatus.Inactive:
          new Batch1().Activate(); break;
      case BatchStatus.Active
          new Batch2().Deactivate(); break;
  
  }
  </code></pre>