title: Database model to object oriented design?
body: <p>How would I design classes say in c# to represents a database model?</p>
  
  <p>Given the following tables and fields for a database,</p>
  
  <p><strong>Table: Employee</strong></p>
  
  <pre><code>Pk EmpID
     Lname
     Fname
     Adress
  Fk DeptID
  </code></pre>
  
  <p><strong>Table: Department</strong></p>
  
  <pre><code>Pk DeptID
     DeptName
     Location
  </code></pre>
  
  <p>Ok so now I want to make 2 classes in C#, one for Employee and one for Department. The part I get hung up on is the foreign keys. Should I use the foreign keys in my design for the objects, or should I put a reference in my Employee class of the Department,or should I put a list of employee references in my Department class,or should I do both? I know if I use foreign keys, it will be less efficient because I will have to search through a list of primary keys that match the foreign key but I probably should include them in the design anyway. </p>