title: How to represent the value reference to my lookup data in my ViewModel?
body: <p>I have a list of (for example) countries in my database, which might have a class representation that looks like;</p>
  
  <pre><code>public class Country {
     public int CountryId { get; set; }
     public string CountryName { get; set; }
  }
  </code></pre>
  
  <p>Now i have a ViewModel class that models a Student for example, and it looks like;</p>
  
  <pre><code>public class StudentViewModel {
     public int StudentId { get; set; }
     public string StudentName { get; set; }
     public int Age { get; set; }
  }
  </code></pre>
  
  <p>When i want to provide the Country the Student comes from, i usually include the following properties in the StudentViewModel class;</p>
  
  <pre><code>public int CountryId { get; set; }
  public string CountryName { get; set; }
  </code></pre>
  
  <p>Now, i not quite sure if i am doing the right thing because on the client (using javascript), i have to keep the CountryId and CountryName synchronized. The reason i have done it this way for a while is because i used the CountryId property to set the initial value of the dropdownlist and CountryName to show the textual value on a different section of the same form.</p>
  
  <p>I would like to know how other people are handling situations like this?</p>