title: MVC - Controller with multiple select lists
body: <p>Are there any good ways to keep my controllers simpler when they have models that depend on a lot of select lists? I try to keep most of my controller actions as simple as possible (hopefully no more than 10 or so lines) but on pages that require a lot of dropdowns my actions usually exceed this:</p>
  
  <pre><code>public class Model
  {
      public IEnumerable&lt;SelectListItem&gt; AllLocations { get; set; }
      public IEnumerable&lt;SelectListItem&gt; TopLocations { get; set; }
      public IEnumerable&lt;SelectListItem&gt; AllTemplates { get; set; }
      public IEnumerable&lt;SelectListItem&gt; TopTemplates { get; set; }
      // ...
  }
  
  [HttpGet]
  public ActionResult Index(int id)
  {
      var domain = Repository.Get(id);
      var model = Mapper.Map&lt;Domain, ViewModel&gt;(item);
  
      // any way to abstract this type of code?
      model.AllLocations = new SelectList(repository.GetAllLocations(), "Value", "Text");
      model.TopLocations = new SelectList(repository.GetTopLocations(), "Value", "Text");
      model.AllTemplates = new SelectList(repository.GetAllTemplates(), "Value", "Text");
      model.TopTemplates = new SelectList(repository.GetTopTemplates(), "Value", "Text");
      // etc. etc.
  
      return View(model);
  }
  
  [HttpPost]
  public ActionResult Index(ViewModel model)
  {
      // any way to abstract this type of code?
      model.AllLocations = new SelectList(repository.GetAllLocations(), "Value", "Text");
      model.TopLocations = new SelectList(repository.GetTopLocations(), "Value", "Text");
      model.AllTemplates = new SelectList(repository.GetAllTemplates(), "Value", "Text");
      model.TopTemplates = new SelectList(repository.GetTopTemplates(), "Value", "Text");
      // etc. etc.
  
      return View(model);
  }
  </code></pre>