Some cleanup around ReflectedControllerDescriptor:
1. Give ReflectedControllerDescriptor and ReflectedAsyncControllerDescriptor a common base class. Today, it's duplicated code.
2. Get rid of ActionDescriptorCreator delegate and just return the ActionDescriptor directly. It’s only used in the async case, and unnecessary (We always invoke the delegate directly after getting it).
3. That should like AsyncActionMethodSelector.FindAction get moved into the base class.
4. Looks like we call GetCustomAttributes *A lot*. MVC never builds up a persistent thing like WebAPI’s ControllerDescriptor/ActionDescriptor, and instead recreates it every time from the MethodInfo. Rather than cache the attribute results, we can cache at a higher level and cache the things we were building from the attributes.
1. Give ReflectedControllerDescriptor and ReflectedAsyncControllerDescriptor a common base class. Today, it's duplicated code.
2. Get rid of ActionDescriptorCreator delegate and just return the ActionDescriptor directly. It’s only used in the async case, and unnecessary (We always invoke the delegate directly after getting it).
3. That should like AsyncActionMethodSelector.FindAction get moved into the base class.
4. Looks like we call GetCustomAttributes *A lot*. MVC never builds up a persistent thing like WebAPI’s ControllerDescriptor/ActionDescriptor, and instead recreates it every time from the MethodInfo. Rather than cache the attribute results, we can cache at a higher level and cache the things we were building from the attributes.