title: Stop one PrimaryKeyID (Int) used in place of another in C#
body: <p>Our database uses auto incrementing integers to store Primary Key fields. These fields are accessed using C#. Recently we've had issues with developers using the wrong primary key fields without thoroughly testing the results. e.g.</p>
  
  <pre><code>int systemUserID = 1234;
  string companyName = company.getCompanyNameFromCompanyID(systemUserID);
  </code></pre>
  
  <p>As you can expect this results in incorrect information being returned. What I am looking for is a solution to reduce the ability for developers to input incorrect IDs when using primary key fields.</p>
  
  <p>Unit Testing is an option but would only work if the data going in is wrong.
  Changing the primary key fields to GUIDs is not an option due to the database size and the errors that would be introduced.</p>
  
  <p>Any way that anyone has seen this before and stopped/limited it?</p>