title: check the checkbox based on model in mvc?
body: <p>I have a edit form which should have checkbox.</p>
  
  <p>My Model for the page is </p>
  
  <pre><code>public class MyModel{
     public string Name {get;set;}
     public List&lt;AdType&gt; AdTypeList { get; set; }
  }
  
  
  Enum AdType{
    [Display(Name = "None")]
          None,
  
          [Display(Name = "Additional")]
          Additional_Photo,
  }
  </code></pre>
  
  <p>So i have to check the check box with respect to the data coming from the database.
  And also update should happen if i make changes and submit.
  To work that way what changes i need to make in my html helper for the checkbox?</p>
  
  <pre><code>foreach (AdType role in Enum.GetValues(typeof(AdType)))
  {
      &lt;label&gt;
          &lt;input name="Roles" type="checkbox" value="@role" checked="@(Model != null)" /&gt;
          @{var x = EHelper.GetDisplayValue&lt;AdType&gt;(role);}
          @x
      &lt;/label&gt;
  }
  </code></pre>
  
  <p>I am new to mvc, please parden if i m doing something stupid.</p>