title: MVC SelectList Drop down default
body: <p>In the SelectList drop down, I like if the Count is 1, I like to default the value of what is there in the drugfamilylist which in this case is just 1 value. I cannot figure out how to do this.
  I had the following below:</p>
  
  <pre><code>        var drugfamilylist = (from dt in DataContext.Drugs
                                select dt.Drugvalue).Distinct().ToList();
  
          if (drugfamilylist.Count == 1)
          {
  
              ViewBag.DrugFamily = new SelectList(drugfamilylist);
  
          }
  </code></pre>
  
  <p>I tried but that idd not work either :</p>
  
  <pre><code>       var drugfamilylist = (from dt in DataContext.Drugs
                                select dt.Drugvalue).Distinct().ToList();
  
          if (drugfamilylist.Count == 1)
          {
  
              ViewBag.DrugFamily = new SelectList(drugfamilylist,drugfamilylist);
  
          }
  </code></pre>