Class DnnAppApiControllerSelector
This is a .net Framework controller selector to handle dynamically compiled controllers inside 2sxc apps.
[InternalApi_DoNotUse_MayChangeWithoutNotice("only made public for docs")]
public class DnnAppApiControllerSelector
- Inheritance
-
objectDnnAppApiControllerSelector
Remarks
It will be registered in the ServicesContainer to override the previous selector. It will
- check if it's responsible (based on url)
- and if yes, hand off to DnnAppApiControllerService to compile / run the app-specific api controllers
- otherwise hand processing back to next api controller up-stream
Constructors
DnnAppApiControllerSelector(HttpConfiguration)
This is a .net Framework controller selector to handle dynamically compiled controllers inside 2sxc apps.
public DnnAppApiControllerSelector(HttpConfiguration configuration)
Parameters
configurationHttpConfiguration
Remarks
It will be registered in the ServicesContainer to override the previous selector. It will
- check if it's responsible (based on url)
- and if yes, hand off to DnnAppApiControllerService to compile / run the app-specific api controllers
- otherwise hand processing back to next api controller up-stream
Methods
GetControllerMapping()
Returns a map, keyed by controller string, of all System.Web.Http.Controllers.HttpControllerDescriptor that the selector can select. This is primarily called by System.Web.Http.Description.IApiExplorer to discover all the possible controllers in the system.
public IDictionary<string, HttpControllerDescriptor> GetControllerMapping()
Returns
- IDictionary<string, HttpControllerDescriptor>
A map of all System.Web.Http.Controllers.HttpControllerDescriptor that the selector can select, or null if the selector does not have a well-defined mapping of System.Web.Http.Controllers.HttpControllerDescriptor.
Register()
Registration in the services so it can handle the requests.
public static void Register()
Remarks
Will remember the previous selector and return that if it doesn't match.
SelectController(HttpRequestMessage)
Selects a System.Web.Http.Controllers.HttpControllerDescriptor for the given System.Net.Http.HttpRequestMessage.
public HttpControllerDescriptor SelectController(HttpRequestMessage request)
Parameters
requestHttpRequestMessageThe request message.
Returns
- HttpControllerDescriptor
An System.Web.Http.Controllers.HttpControllerDescriptor instance.