title: Avoiding foreach for @html.checkboxfor
body: <p>I am developing an application using MVC. I had a requirement where I have to display checkbox for a list.</p>
  
  <p>I was going through different posts for doing this, one of them is the use of avoiding foreach for looping and making use of @html.editorfor() as described in the answer by Darwin dimitrov <a href="https://stackoverflow.com/questions/11652606/how-to-use-html-checkboxfor-while-dealing-with-a-listviewmodel">here</a>:</p>
  
  <p>This answer works fabulously fine, but I have a clarification , it is:</p>
  
  <ol>
  <li><p>In the same view I have 2 requirements , the one with checkboxfor and the other one with radiobuttonfor
  So, If I am using </p>
  
  <p><code>&lt;div&gt;@Html.EditorFor(x =&gt; x.RoleAccess)&lt;/div&gt;</code></p></li>
  </ol>
  
  <p>How do I write the (~/Views/Shared/EditorTemplates/RoleAccessViewModel.cshtml) to serve for checkboxfor for one requirement , and the other one for @radiobuttonfor .</p>
  
  <p>Wont this approach be hardcoded which will always render the RoleAccessViewModel.cshtml whenever <code>EditorFor(x =&gt; x.RoleAccess)</code> is used?Please execuse me If I have used any technical terms wrong way,as I still a novice in mvc.</p>