ApiController Class
TOC
Collapse the table of content
Expand the table of content

ApiController Class

 

Defines properties and methods for API controller.

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

System.Object
  System.Web.Http.ApiController

public abstract class ApiController : IHttpController, IDisposable

NameDescription
System_CAPS_pubpropertyActionContext

Gets the action context.

System_CAPS_pubpropertyConfiguration

Gets the HttpConfiguration of the current ApiController.

System_CAPS_pubpropertyControllerContext

Gets the HttpConfiguration of the current ApiController.

System_CAPS_pubpropertyModelState

Gets the model state after the model binding process.

System_CAPS_pubpropertyRequest

Gets or sets the HttpRequestMessage of the current ApiController.

System_CAPS_pubpropertyRequestContext

Gets the request context.

System_CAPS_pubpropertyUrl

Gets an instance of a UrlHelper, which is used to generate URLs to other APIs.

System_CAPS_pubpropertyUser

Returns the current principal associated with this request.

NameDescription
System_CAPS_protmethodBadRequest()

Creates a BadRequestResult.

System_CAPS_protmethodBadRequest(ModelStateDictionary)

Creates an InvalidModelStateResult with the specified model state.

System_CAPS_protmethodBadRequest(String)

Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message.

System_CAPS_protmethodConflict()

Creates a ConflictResult (409 Conflict).

System_CAPS_protmethodContent<T>(HttpStatusCode, T)

Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter, MediaTypeHeaderValue)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

System_CAPS_protmethodContent<T>(HttpStatusCode, T, MediaTypeFormatter, String)

Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values.

System_CAPS_protmethodCreated<T>(String, T)

Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values.

System_CAPS_protmethodCreated<T>(Uri, T)

Creates a CreatedNegotiatedContentResult<T> (201 Created) with the specified values.

System_CAPS_protmethodCreatedAtRoute<T>(String, IDictionary<String, Object>, T)

Creates a CreatedAtRouteNegotiatedContentResult<T> (201 Created) with the specified values.

System_CAPS_protmethodCreatedAtRoute<T>(String, Object, T)

Creates a CreatedAtRouteNegotiatedContentResult<T> (201 Created) with the specified values.

System_CAPS_pubmethodDispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExecuteAsync(HttpControllerContext, CancellationToken)

Executes asynchronously a single HTTP operation.

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodInitialize(HttpControllerContext)

Initializes the ApiController instance with the specified controllerContext.

System_CAPS_protmethodInternalServerError()

Creates an InternalServerErrorResult (500 Internal Server Error).

System_CAPS_protmethodInternalServerError(Exception)

Creates an ExceptionResult (500 Internal Server Error) with the specified exception.

System_CAPS_protmethodJson<T>(T)

Creates a JsonResult<T> (200 OK) with the specified value.

System_CAPS_protmethodJson<T>(T, JsonSerializerSettings)

Creates a JsonResult<T> (200 OK) with the specified values.

System_CAPS_protmethodJson<T>(T, JsonSerializerSettings, Encoding)

Creates a JsonResult<T> (200 OK) with the specified values.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodNotFound()

Creates a NotFoundResult.

System_CAPS_protmethodOk()

Creates an OkResult (200 OK).

System_CAPS_protmethodOk<T>(T)

Creates an OkNegotiatedContentResult<T> with the specified values.

System_CAPS_protmethodRedirect(String)

Creates a redirect result (302 Found) with the specified value.

System_CAPS_protmethodRedirect(Uri)

Creates a redirect result (302 Found) with the specified value.

System_CAPS_protmethodRedirectToRoute(String, IDictionary<String, Object>)

Creates a redirect to route result (302 Found) with the specified values.

System_CAPS_protmethodRedirectToRoute(String, Object)

Creates a redirect to route result (302 Found) with the specified values.

System_CAPS_protmethodResponseMessage(HttpResponseMessage)

Creates a ResponseMessageResult with the specified response.

System_CAPS_protmethodStatusCode(HttpStatusCode)

Creates a T:System.Web.Http.StatusCodeResult with the specified status code.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_protmethodUnauthorized(AuthenticationHeaderValue[])

Creates an UnauthorizedResult (401 Unauthorized) with the specified values.

System_CAPS_protmethodUnauthorized(IEnumerable<AuthenticationHeaderValue>)

Creates an UnauthorizedResult (401 Unauthorized) with the specified values.

System_CAPS_pubmethodValidate<TEntity>(TEntity)

Validates the given entity and adds the validation errors to the model state under the empty prefix, if any.

System_CAPS_pubmethodValidate<TEntity>(TEntity, String)

Validates the given entity and adds the validation errors to the model state, if any.

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

Return to top
Show:
© 2016 Microsoft