maartenba / MvcSiteMapProvider

An ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework.
Microsoft Public License
537 stars 220 forks source link

Mutiple AttributeRoutes with different verbs not resolving breadcrumb #463

Open martinjt opened 7 years ago

martinjt commented 7 years ago

It's a bit of a weird setup, possibly, so don't know if this is actually a bug or not.

I have

[HttpDelete]
[Route("{id:int}/provider/{providerId:int?}", Order = 3)]
public async Task<ActionResult> DeleteProvider(int id, int? providerId)
{
..
}

Then

[Route("{id:int}/provider/{providerId:int}", Order = 1)]
[MvcSiteMapNode(Title = "Edit Provider", ParentKey = "listProviders", Key = "EditProvider", ResourceKey = "<key>", PreservedRouteParameters = "id,providerId")]
        public async Task<ActionResult> EditProvider(int id, int providerId)
{
..
}

This doesn't resolve the breadcrumb when doing:

@Html.SiteMapPath()

However, if I remove the HttpDelete method entirely, it works fine.

Like I said, probably an obscure usecase, happy to try and build a small repo, but putting this here initially to see if it's a known issue.