title: How would my model be in MVC3 if I needed to reference a foreign key, for example CountryID?
body: <p>Here's what I have so far Model and View:</p>
  
  <pre><code>public class RegisterModel
  {
      [Required]
      [Display(Name = "Usuario")]
      public string UserName { get; set; }
  
      [Required]
      [DataType(DataType.EmailAddress)]
      [Display(Name = "Correo")]
      public string Email { get; set; }
  
      [Required]
      [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
      [DataType(DataType.Password)]
      [Display(Name = "Contraseña")]
      public string Password { get; set; }
  
      [DataType(DataType.Password)]
      [Display(Name = "Confirme Su Contraseña")]
      [Compare("Password", ErrorMessage = "Sus contraseñas no son las mismas.")]
      public string ConfirmPassword { get; set; }
  
      [Required]
      [Display(Name = "Direccion")]
      public string Address { get; set; }
  
      [Required]
      [Display(Name = "Telefono Fijo")]
      public string Telephone { get; set; }
  
      [Required]
      [Display(Name = "Celular")]
      public string MobilePhone { get; set; }
  
      [Required]
      [Display(Name = "Fecha de Nacimiento")]
      public DateTime DateOfBirth { get; set; }
  
      [Required]
      [Display(Name = "Sexo")]
      public bool Sex { get; set; }
  
      [Required]
      [Display(Name = "Pais")]
      public int Country { get; set; }
  }
  
  @model Foo.WebUI.Models.RegisterModel
  
  @{
      ViewBag.Title = "Register";
  }
  
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;div id="registerform"&gt;
      &lt;h2&gt;Cree Su Cuenta&lt;/h2&gt;
  
      @using (Html.BeginForm())
      {
          @Html.ValidationSummary(true)        
  
              &lt;h3&gt;Informacion de Usuario&lt;/h3&gt;
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.UserName)
                  @Html.EditorFor(model =&gt; model.UserName)
                  @Html.ValidationMessageFor(model =&gt; model.UserName)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Email)
                  @Html.EditorFor(model =&gt; model.Email)
                  @Html.ValidationMessageFor(model =&gt; model.Email)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Password)
                  @Html.EditorFor(model =&gt; model.Password)
                  @Html.ValidationMessageFor(model =&gt; model.Password)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.ConfirmPassword)
                  @Html.EditorFor(model =&gt; model.ConfirmPassword)
                  @Html.ValidationMessageFor(model =&gt; model.ConfirmPassword)
              &lt;/div&gt;
  
              &lt;h3&gt;Informacion Personal&lt;/h3&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Address)
                  @Html.EditorFor(model =&gt; model.Address)
                  @Html.ValidationMessageFor(model =&gt; model.Address)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Telephone)    
                  @Html.EditorFor(model =&gt; model.Telephone)
                  @Html.ValidationMessageFor(model =&gt; model.Telephone)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.MobilePhone)
                  @Html.EditorFor(model =&gt; model.MobilePhone)
                  @Html.ValidationMessageFor(model =&gt; model.MobilePhone)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.DateOfBirth)
                  @Html.EditorFor(model =&gt; model.DateOfBirth)
                  @Html.ValidationMessageFor(model =&gt; model.DateOfBirth)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Sex)
                  @Html.EditorFor(model =&gt; model.Sex)
                  @Html.ValidationMessageFor(model =&gt; model.Sex)
              &lt;/div&gt;
  
              &lt;div class="editor-field"&gt;
                  @Html.LabelFor(model =&gt; model.Country)
                  @Html.EditorFor(model =&gt; model.Country)
                  @Html.ValidationMessageFor(model =&gt; model.Country)
              &lt;/div&gt;
  
              &lt;p&gt;
                  &lt;input type="submit" value="Create" /&gt;
              &lt;/p&gt;
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>Now, since my User will belong to a single country, in the database it has a foreign key reference to the Country table. In my model, I set the Country property to be of type int. Is this correct?</p>
  
  <p>How would I correctly set this up so a dropdownlist is shown for choosing a country in the View but a numerical value is saved for persistance to the database?</p>