Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

RouteGroupConstraint should only be added once for non attribute routed actions #1035

Closed
javiercn opened this issue Aug 19, 2014 · 0 comments
Assignees
Milestone

Comments

@javiercn
Copy link
Member

Given the following controllers and actions

private class MixedAttributeRouteController
{
    [HttpGet("Index")]
    public void Index() { }

    [HttpGet("Edit")]
    public void Edit() { }

    public void AnotherNonAttributedAction() { }
}

[MyRouteConstraint(blockNonAttributedActions: true)]
[MySecondRouteConstraint(blockNonAttributedActions: true)]
private class ConstrainedController
{
    public void ConstrainedNonAttributedAction() { }
}

AnotherNonAttributedAction gets added once RouteGroupConstraint for each RouteDataConstraint defined in a Controller. So in the above example it will end up with two route data constraints.

@javiercn javiercn added this to the 6.0.0-alpha4 milestone Aug 19, 2014
@javiercn javiercn self-assigned this Aug 19, 2014
javiercn added a commit that referenced this issue Aug 19, 2014
attribute routed actions

1. Changed ReflectedActionDescriptorProvider to add RouteGroupConstraint only once
   for non attribute routed actions.

2. Added tests to cover the scenario.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants