Class WebApiModule
A module using class methods as handlers.
Public instance methods that match the WebServerModule.ResponseHandler signature, and have the WebApi handler attribute will be used to respond to web server requests.
Inherited Members
Namespace: EmbedIO.WebApi
Syntax
public class WebApiModule : WebApiModuleBase
Constructors
WebApiModule(String)
Initializes a new instance of the WebApiModule class, using the default response serializer.
Declaration
public WebApiModule(string baseRoute)
Parameters
Type | Name | Description |
---|---|---|
String | baseRoute | The base URL path served by this module. |
See Also
WebApiModule(String, ResponseSerializerCallback)
Initializes a new instance of the WebApiModule class, using the specified response serializer.
Declaration
public WebApiModule(string baseRoute, ResponseSerializerCallback serializer)
Parameters
Type | Name | Description |
---|---|---|
String | baseRoute | The base URL path served by this module. |
ResponseSerializerCallback | serializer | A ResponseSerializerCallback used to serialize
the result of controller methods returning langword_csharp_object
or |
See Also
Methods
RegisterController(Type)
Registers a controller type using a constructor.
See RegisterControllerType(Type) for further information.
Declaration
public void RegisterController(Type controllerType)
Parameters
Type | Name | Description |
---|---|---|
Type | controllerType | The type of the controller. |
See Also
RegisterController(Type, Func<WebApiController>)
Registers a controller type using a factory method.
See RegisterControllerType(Type, Func<WebApiController>) for further information.
Declaration
public void RegisterController(Type controllerType, Func<WebApiController> factory)
Parameters
Type | Name | Description |
---|---|---|
Type | controllerType | The type of the controller. |
Func<WebApiController> | factory | The factory method used to construct instances of |
See Also
RegisterController<TController>()
Registers a controller type using a constructor.
See RegisterControllerType<TController>() for further information.
Declaration
public void RegisterController<TController>()
where TController : WebApiController, new()
Type Parameters
Name | Description |
---|---|
TController | The type of the controller. |
See Also
RegisterController<TController>(Func<TController>)
Registers a controller type using a factory method.
See RegisterControllerType<TController>(Func<TController>) for further information.
Declaration
public void RegisterController<TController>(Func<TController> factory)
where TController : WebApiController
Parameters
Type | Name | Description |
---|---|---|
Func<TController> | factory | The factory method used to construct instances of |
Type Parameters
Name | Description |
---|---|
TController | The type of the controller. |