mccalltd/AttributeRouting — Issue #26: AttributeRouting and SiteMap. Did anyone implemented something similar?
Author: shapper
Created: 2011-12-03 01:15:26+00:00
State: open

Hello,

I am trying to implement a SiteMap service compatible with AttributeRouting

[Sitemap(Priority = 0.8, Frequency = Frequency.Hourly)]
[GET("Articles/Recent")]
public ActionResult Index()
{
return View();
}

I created the attribute which can be used without or with parameters (Priority, Frequency).

My idea is to have a Sitemap/Index action where I would:

1 - Get all routes with Sitemap attribute together with custom info.

2 - Generate custom routes. For example, a route like:

[GET("Post/{id}")]
[Sitemap(Priority = 0.8, Frequency = Frequency.Hourly)]
public ActionResult Index(int id)
{
return View();
}

In this case I would get the route and on the Sitemap/Index action I would generate N sitemap entries.
Each entry would be created with a new ID gotten from the database.

How to link this idea with AttributeRouting?

Did anyone ever did something like this?

Thank You,
Miguel