title: How do you pass an enum from the MVC model and controller to KnockOutJS model
body: <p>I'm a little behind on my enums and would appreciate some direction on how to pass an enums from the mvc controller via JsonResult to populate a dropdownlist. I have all my other properties passing just fine. Its only the enum as follows:</p>
  
  <p><strong>Enum</strong></p>
  
  <pre><code>public enum SpeciesType{
    Mammal = 1;
    Reptile = 2; }
  </code></pre>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>public int Id {get; set;}
  
  public string AnimalName {get; set;}
  
  public DateTime DateOfRecording { get; set; }
  
  public SpeciesType Species { get; set; }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public JsonResult EditAnimalRecord(int animalId){
  var model = new EditViewModel();
    var record = (Linq statement in here);
  
    if(record.Id &gt; 104){
  
     model.Id = record.Id;
     model.AniamlName = record.Name;
     model.DateOfRecording = record.DateEntered;
     model.Species = ???(Need to pass enums here) to populate dropdown via JS   
     }
  return Json(model, JsonRequestBehavior.AllowGet)
  }
  </code></pre>