A module using objects derived from WebApiController as collections of handler methods.
InheritanceWebApiModuleBase
Namespace: EmbedIO.WebApi Syntaxpublic abstract class WebApiModuleBase : RoutingModuleBase
Constructors WebApiModuleBase(String)
Initializes a new instance of the WebApiModuleBase class, using the default response serializer.
Declarationprotected WebApiModuleBase(string baseRoute)
Parameters Type Name Description String baseRoute
The base route served by this module.
See Also WebApiModuleBase(String, ResponseSerializerCallback)Initializes a new instance of the WebApiModuleBase class, using the specified response serializer.
Declarationprotected WebApiModuleBase(string baseRoute, ResponseSerializerCallback serializer)
Parameters See Also Properties ControllerCount
Gets the number of controller types registered in this module.
Declarationpublic int ControllerCount { get; }
Property Value Serializer
A ResponseSerializerCallback used to serialize the result of controller methods returning values.
Declarationpublic ResponseSerializerCallback Serializer { get; }
Property Value Methods RegisterControllerType(Type)
Registers a controller type using a constructor.
In order for registration to be successful, the specified controllerType
:
protected void RegisterControllerType(Type controllerType)
Parameters Type Name Description Type controllerType
The type of the controller.
See Also RegisterControllerType(Type, Func<WebApiController>)Registers a controller type using a factory method.
In order for registration to be successful:
controllerType
must be a subclass of WebApiController;controllerType
must not be a generic type definition;factory
's return type must be either controllerType
or a subclass of controllerType
.protected void RegisterControllerType(Type controllerType, Func<WebApiController> factory)
Parameters Type Name Description Type controllerType
The type of the controller.
Func<WebApiController> factoryThe factory method used to construct instances of controllerType
.
Registers a controller type using a constructor.
In order for registration to be successful, the specified controller type:
protected void RegisterControllerType<TController>()
where TController : WebApiController, new()
Type Parameters Name Description TController
The type of the controller.
See Also RegisterControllerType<TController>(Func<TController>)Registers a controller type using a factory method.
In order for registration to be successful:
TController
must be a subclass of WebApiController;TController
must not be a generic type definition;factory
's return type must be either TController
or a subclass of TController
.protected void RegisterControllerType<TController>(Func<TController> factory)
where TController : WebApiController
Parameters Type Name Description Func<TController> factory
The factory method used to construct instances of TController
.
The type of the controller.
See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4