Partager via


ApiController Class

Defines properties and methods for API controller.

Inheritance Hierarchy

System.Object
  System.Web.Http.ApiController

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

Syntax

'Declaration
Public MustInherit Class ApiController _
    Implements IHttpController, IDisposable
'Usage
Dim instance As ApiController
public abstract class ApiController : IHttpController, 
    IDisposable
public ref class ApiController abstract : IHttpController, 
    IDisposable
[<AbstractClassAttribute>]
type ApiController =  
    class
        interface IHttpController
        interface IDisposable
    end
public abstract class ApiController implements IHttpController, IDisposable

The ApiController type exposes the following members.

Constructors

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

Top

Properties

  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.

Top

Methods

  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.)

Top

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

Reference

System.Web.Http Namespace