Share via

ApiController Class

Defines properties and methods for API controller.

Inheritance Hierarchy


Namespace:  System.Web.Http
Assembly:  System.Web.Http (in System.Web.Http.dll)


Public MustInherit Class ApiController _
    Implements IHttpController, IDisposable
Dim instance As ApiController
public abstract class ApiController : IHttpController, 
public ref class ApiController abstract : IHttpController, 
type ApiController =  
        interface IHttpController
        interface IDisposable
public abstract class ApiController implements IHttpController, IDisposable

The ApiController type exposes the following members.


  Name Description
Protected method ApiController Initializes a new instance of the ApiController class.



  Name Description
Public property Configuration Gets or sets the HttpConfiguration of the current ApiController.
Public property ControllerContext Gets the HttpControllerContext of the current ApiController.
Public property ModelState Gets the model state after the model binding process.
Public property Request Gets or sets the HttpRequestMessage of the current ApiController.
Public property Url Returns an instance of a UrlHelper, which is used to generate URLs to other APIs.
Public property User Returns the current principal associated with this request.



  Name Description
Public method Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected method Dispose(Boolean) Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources.
Public method Equals (Inherited from Object.)
Public method ExecuteAsync Executes asynchronously a single HTTP operation.
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method Initialize Initializes the ApiController instance with the specified controllerContext.
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


System.Web.Http Namespace