-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ReflectedActionDescriptorProvider does not ignore private types #610
Comments
Potential fix locates at https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs#L51 and
|
Investigate, compare MVC & Web API, and come up with a recommednation |
In summary, I would recommend to add On the other hand, this kind of hierarchies below is meaningless because hierarchies are achieved by routes and areas.
To make it even more explicit, we could also add Repro and Investigation
The inconsistency is caused by: MVC5.2:
Web API:
MVC6.0, neither
|
@yishaigalatzer , what is your idea? |
Decision here is to use MVC5's behavior. Only public-top-level classes will be considered as controllers by default. This is easy to customize by overriding |
This change exludes internal and nested types from being treated as controllers. This is consistent with MVC5's behavior. DefaultActionSelectionConventions was primarily tested through running action selection. I wanted to also test the methods with substantial logic in this class, so I moved a spate of a classes from private classes inside of the integration tests to public classes so they could be shared. I also added tests to fill gaps in DefaultActionSelectionConventions, which is the vast vast majority of this change.
This change exludes internal and nested types from being treated as controllers. This is consistent with MVC5's behavior. DefaultActionSelectionConventions was primarily tested through running action selection. I wanted to also test the methods with substantial logic in this class, so I moved a spate of a classes from private classes inside of the integration tests to public classes so they could be shared. I also added tests to fill gaps in DefaultActionSelectionConventions, which is the vast vast majority of this change.
This change exludes internal and nested types from being treated as controllers. This is consistent with MVC5's behavior. DefaultActionSelectionConventions was primarily tested through running action selection. I wanted to also test the methods with substantial logic in this class, so I moved a spate of a classes from private classes inside of the integration tests to public classes so they could be shared. I also added tests to fill gaps in DefaultActionSelectionConventions, which is the vast vast majority of this change.
Fixed by bff94f1 |
https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs#L50 does not filter out non-public types (and possibly other non-interesting types). We need to be more restrictive about the things that get filtered by it.
The text was updated successfully, but these errors were encountered: