title: How would you store tabular constant Data in your C# project?
body: <p>I am currently writing a plugin to a CAD style software. The plugin does calculations based on data read from the CAD model and a lot of table lookups (think <em>printed</em> tables in a calculation guide). I inherited this plugin and the current solution defines a class <code>Constant</code> which has a bunch of static struct members and two-dimensional arrays. These arrays are then indexed by enum values at runtime to find the appropriate data.</p>
  
  <p>I'm not too happy with the solution, as the representation in the <code>Constant</code> class is kind of hard to read - the enum values used when retrieving data are of course not visible when <em>editing</em> the data (although that only ever happens manually and very seldom).</p>
  
  <p>I'd prefer not to bundle a DB (and engine) with a small plugin, but would like similar semantics, for instance using LINQ to select values where some fields match etc.</p>
  
  <p>What is your preferred solution to this problem?</p>
  
  <ul>
  <li>do you use a bunch of XML files and parse them at runtime?</li>
  <li>do you use a templating engine (t4?) to generate classes from XML files at compile time?</li>
  <li>do you store XML versions of datasets in the resources (read 'em in at runtime, LINQ to dataset...)</li>
  <li>would you just keep the <code>Constants</code> class, maybe add some documentation to the members (don't get me started about legacy code with no comments whatsoever...)</li>
  </ul>