title: Generate actionlinks with model data
body: <p>I would like to fill a list of actionlinks with data from a model. In order to achieve this I created a model called ActionLinkModel</p>
  
  <pre><code>public class ActionLinkModel
  {
      public ActionLinkModel(string linkText, string actionName = "Index", string controllerName = "Home", Dictionary&lt;string, string&gt; routeValues = null, Dictionary&lt;string, string&gt; htmlAttributes = null)
      {
          LinkText = linkText;
          ActionName = actionName;
          ControllerName = controllerName;
          RouteValues = routeValues == null ? new Dictionary&lt;string, string&gt;() : routeValues;
          HtmlAttributes = htmlAttributes == null ? new Dictionary&lt;string, string&gt;(): htmlAttributes;
          if(!HtmlAttributes.ContainsKey("title")) {
              HtmlAttributes.Add("title",linkText);
          }
      }
  
      public string LinkText { get; set; }
      public string ActionName { get; set; }
      public string ControllerName { get; set; }
      public Dictionary&lt;string, string&gt; RouteValues { get; set; }
      public Dictionary&lt;string, string&gt; HtmlAttributes { get; set; }
  
  }
  </code></pre>
  
  <p>Then in my view I call it like this:</p>
  
  <pre><code>@foreach (var link in Model.Links) {
     @Html.ActionLink(link.LinkText, link.ActionName, link.ControllerName, link.RouteValues, link.HtmlAttributes);
  } 
  </code></pre>
  
  <p>Unfortunately this doesn't render the way i was hoping for, the problem is with routevalues and htmlAttibutes. I can't figure out what type they need to be, in the signature of Html.Actionlink I see they are either objects or RouteValueDictionary / IDictionary.
  Also I have seen constructions like this:</p>
  
  <p>Html.ActionLink("Home", "Index", "Home", null,
                       new { title="Home", class="myClass"})</p>
  
  <p>but what type is  <code>new { title="Home", class="myClass"}</code>  creating?</p>
  
  <p>How do i do this?, i would like to take care of things in the model and keep the code in the view as simple as possible.</p>