title: How to set metadata for controller and action methods?
body: <p>I'm using this code for displaying all controllers name with action methods:</p>
  
  <pre><code>public ActionResult GetAllControllers()
          {
              var controllers = typeof (MvcApplication).Assembly.GetTypes().Where(typeof (IController).IsAssignableFrom);
              return View(controllers.ToList());
          }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;ul id="treeView"&gt;
      @foreach (var item in Model)
      {
              &lt;li&gt;
                  @item.Name
                  &lt;ul&gt;
                      @foreach (var action in item.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(method =&gt; typeof(ActionResult).IsAssignableFrom(method.ReturnType)))
                      {
                          &lt;li&gt;@action.Name&lt;/li&gt;
                      }
                  &lt;/ul&gt;
              &lt;/li&gt;
      }
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>The result is look like this:</p>
  
  <pre><code>HomeController
       Index
       About
  MainController
       Index
       Create
       Edit
       Delete
  ...
  </code></pre>
  
  <p>Now my question is that: Is there any way to set a name for controller and action method as display result? For example something like this:</p>
  
  <pre><code>[SetName("MainPage")]
  public class HomeController : Controller
  {
      [SetName("ProductList")]
      public ActionResult Index()
      {
          //
      }
      // other action methods
  }
  </code></pre>
  
  <p>So in this case the result for displaying controllers name and action methods would be:</p>
  
  <pre><code>MainPage
     ProductList
  ... 
  </code></pre>