Controller Class
Definition
A base class for an MVC controller with view support.
public ref class Controller abstract : Microsoft::AspNetCore::Mvc::ControllerBase, IDisposable, Microsoft::AspNetCore::Mvc::Filters::IActionFilter, Microsoft::AspNetCore::Mvc::Filters::IAsyncActionFilter
public abstract class Controller : Microsoft.AspNetCore.Mvc.ControllerBase, IDisposable, Microsoft.AspNetCore.Mvc.Filters.IActionFilter, Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter
type Controller = class
inherit ControllerBase
interface IActionFilter
interface IFilterMetadata
interface IAsyncActionFilter
interface IDisposable
Public MustInherit Class Controller
Inherits ControllerBase
Implements IActionFilter, IAsyncActionFilter, IDisposable
- Inheritance
- Implements
Constructors
Controller() |
Properties
ControllerContext |
Gets or sets the ControllerContext. (Inherited from ControllerBase) |
HttpContext |
Gets the HttpContext for the executing action. (Inherited from ControllerBase) |
MetadataProvider |
Gets or sets the IModelMetadataProvider. (Inherited from ControllerBase) |
ModelBinderFactory |
Gets or sets the IModelBinderFactory. (Inherited from ControllerBase) |
ModelState |
Gets the ModelStateDictionary that contains the state of the model and of model-binding validation. (Inherited from ControllerBase) |
ObjectValidator |
Gets or sets the IObjectModelValidator. (Inherited from ControllerBase) |
ProblemDetailsFactory |
Gets or sets the ProblemDetailsFactory. (Inherited from ControllerBase) |
Request |
Gets the HttpRequest for the executing action. (Inherited from ControllerBase) |
Response |
Gets the HttpResponse for the executing action. (Inherited from ControllerBase) |
RouteData |
Gets the RouteData for the executing action. (Inherited from ControllerBase) |
TempData |
Gets or sets ITempDataDictionary used by ViewResult. |
Url |
Gets or sets the IUrlHelper. (Inherited from ControllerBase) |
User |
Gets the ClaimsPrincipal for user associated with the executing action. (Inherited from ControllerBase) |
ViewBag |
Gets the dynamic view bag. |
ViewData |
Gets or sets ViewDataDictionary used by ViewResult and ViewBag. |
Methods
Accepted() |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
Accepted(Object) |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
Accepted(String) |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
Accepted(String, Object) |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
Accepted(Uri) |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
Accepted(Uri, Object) |
Creates a AcceptedResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String, Object) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String, Object, Object) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String, String) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String, String, Object) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtAction(String, String, Object, Object) |
Creates a AcceptedAtActionResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtRoute(Object) |
Creates a AcceptedAtRouteResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtRoute(Object, Object) |
Creates a AcceptedAtRouteResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtRoute(String) |
Creates a AcceptedAtRouteResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtRoute(String, Object) |
Creates a AcceptedAtRouteResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
AcceptedAtRoute(String, Object, Object) |
Creates a AcceptedAtRouteResult object that produces an Status202Accepted response. (Inherited from ControllerBase) |
BadRequest() |
Creates an BadRequestResult that produces a Status400BadRequest response. (Inherited from ControllerBase) |
BadRequest(ModelStateDictionary) |
Creates an BadRequestObjectResult that produces a Status400BadRequest response. (Inherited from ControllerBase) |
BadRequest(Object) |
Creates an BadRequestObjectResult that produces a Status400BadRequest response. (Inherited from ControllerBase) |
Challenge() |
Creates a ChallengeResult. (Inherited from ControllerBase) |
Challenge(AuthenticationProperties) |
Creates a ChallengeResult with the specified |
Challenge(AuthenticationProperties) |
Creates a ChallengeResult with the specified |
Challenge(AuthenticationProperties, String[]) |
Creates a ChallengeResult with the specified specified authentication schemes and
|
Challenge(AuthenticationProperties, String[]) |
Creates a ChallengeResult with the specified authentication schemes and
|
Challenge(String[]) |
Creates a ChallengeResult with the specified authentication schemes. (Inherited from ControllerBase) |
Conflict() |
Creates an ConflictResult that produces a Status409Conflict response. (Inherited from ControllerBase) |
Conflict(ModelStateDictionary) |
Creates an ConflictObjectResult that produces a Status409Conflict response. (Inherited from ControllerBase) |
Conflict(Object) |
Creates an ConflictObjectResult that produces a Status409Conflict response. (Inherited from ControllerBase) |
Content(String) |
Creates a ContentResult object by specifying a |
Content(String, MediaTypeHeaderValue) |
Creates a ContentResult object by specifying a
|
Content(String, String) |
Creates a ContentResult object by specifying a
|
Content(String, String, Encoding) |
Creates a ContentResult object by specifying a
|
Created(String, Object) |
Creates a CreatedResult object that produces a Status201Created response. (Inherited from ControllerBase) |
Created(Uri, Object) |
Creates a CreatedResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtAction(String, Object) |
Creates a CreatedAtActionResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtAction(String, Object, Object) |
Creates a CreatedAtActionResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtAction(String, String, Object, Object) |
Creates a CreatedAtActionResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtRoute(Object, Object) |
Creates a CreatedAtRouteResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtRoute(String, Object) |
Creates a CreatedAtRouteResult object that produces a Status201Created response. (Inherited from ControllerBase) |
CreatedAtRoute(String, Object, Object) |
Creates a CreatedAtRouteResult object that produces a Status201Created response. (Inherited from ControllerBase) |
Dispose() | |
Dispose(Boolean) |
Releases all resources currently used by this Controller instance. |
File(Byte[], String) |
Returns a file with the specified |
File(Byte[], String, Boolean) |
Returns a file with the specified |
File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns a file with the specified |
File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns a file with the specified |
File(Byte[], String, String) |
Returns a file with the specified |
File(Byte[], String, String, Boolean) |
Returns a file with the specified |
File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns a file with the specified |
File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns a file with the specified |
File(Stream, String) |
Returns a file in the specified |
File(Stream, String, Boolean) |
Returns a file in the specified |
File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns a file in the specified |
File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns a file in the specified |
File(Stream, String, String) |
Returns a file in the specified |
File(Stream, String, String, Boolean) |
Returns a file in the specified |
File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns a file in the specified |
File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns a file in the specified |
File(String, String) |
Returns the file specified by |
File(String, String, Boolean) |
Returns the file specified by |
File(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns the file specified by |
File(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns the file specified by |
File(String, String, String) |
Returns the file specified by |
File(String, String, String, Boolean) |
Returns the file specified by |
File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns the file specified by |
File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns the file specified by |
Forbid() |
Creates a ForbidResult (Status403Forbidden by default). (Inherited from ControllerBase) |
Forbid(AuthenticationProperties) |
Creates a ForbidResult (Status403Forbidden by default) with the
specified |
Forbid(AuthenticationProperties) |
Creates a ForbidResult with the specified |
Forbid(AuthenticationProperties, String[]) |
Creates a ForbidResult (Status403Forbidden by default) with the
specified authentication schemes and |
Forbid(AuthenticationProperties, String[]) |
Creates a ForbidResult with the specified specified authentication schemes and
|
Forbid(String[]) |
Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes. (Inherited from ControllerBase) |
Json(Object) |
Creates a JsonResult object that serializes the specified |
Json(Object, JsonSerializerSettings) |
Creates a JsonResult object that serializes the specified |
Json(Object, Object) |
Creates a JsonResult object that serializes the specified |
LocalRedirect(String) |
Creates a LocalRedirectResult object that redirects
(Status302Found) to the specified local |
LocalRedirectPermanent(String) |
Creates a LocalRedirectResult object with Permanent set to
true (Status301MovedPermanently) using the specified |
LocalRedirectPermanentPreserveMethod(String) |
Creates a LocalRedirectResult object with Permanent set to
true and PreserveMethod set to true
(Status308PermanentRedirect) using the specified |
LocalRedirectPreserveMethod(String) |
Creates a LocalRedirectResult object with Permanent set to
false and PreserveMethod set to true
(Status307TemporaryRedirect) using the specified |
NoContent() |
Creates a NoContentResult object that produces an empty Status204NoContent response. (Inherited from ControllerBase) |
NotFound() |
Creates an NotFoundResult that produces a Status404NotFound response. (Inherited from ControllerBase) |
NotFound(Object) |
Creates an NotFoundObjectResult that produces a Status404NotFound response. (Inherited from ControllerBase) |
Ok() |
Creates a OkResult object that produces an empty Status200OK response. (Inherited from ControllerBase) |
Ok(Object) |
Creates an OkObjectResult object that produces an Status200OK response. (Inherited from ControllerBase) |
OnActionExecuted(ActionExecutedContext) |
Called after the action method is invoked. |
OnActionExecuting(ActionExecutingContext) |
Called before the action method is invoked. |
OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) |
Called before the action method is invoked. |
PartialView() |
Creates a PartialViewResult object that renders a partial view to the response. |
PartialView(Object) |
Creates a PartialViewResult object by specifying a |
PartialView(String) |
Creates a PartialViewResult object by specifying a |
PartialView(String, Object) |
Creates a PartialViewResult object by specifying a |
PhysicalFile(String, String) |
Returns the file specified by |
PhysicalFile(String, String, Boolean) |
Returns the file specified by |
PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns the file specified by |
PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns the file specified by |
PhysicalFile(String, String, String) |
Returns the file specified by |
PhysicalFile(String, String, String, Boolean) |
Returns the file specified by |
PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) |
Returns the file specified by |
PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) |
Returns the file specified by |
Problem(String, String, Nullable<Int32>, String, String) |
Creates an ObjectResult that produces a ProblemDetails response. (Inherited from ControllerBase) |
Redirect(String) |
Creates a RedirectResult object that redirects (Status302Found)
to the specified |
RedirectPermanent(String) |
Creates a RedirectResult object with Permanent set to true
(Status301MovedPermanently) using the specified |
RedirectPermanentPreserveMethod(String) |
Creates a RedirectResult object with Permanent set to true
and PreserveMethod set to true (Status308PermanentRedirect)
using the specified |
RedirectPreserveMethod(String) |
Creates a RedirectResult object with Permanent set to false
and PreserveMethod set to true (Status307TemporaryRedirect)
using the specified |
RedirectToAction() |
Redirects (Status302Found) to an action with the same name as current one. The 'controller' and 'action' names are retrieved from the ambient values of the current request. (Inherited from ControllerBase) |
RedirectToAction(String) |
Redirects (Status302Found) to the specified action using the |
RedirectToAction(String, Object) |
Redirects (Status302Found) to the specified action using the
|
RedirectToAction(String, String) |
Redirects (Status302Found) to the specified action using the
|
RedirectToAction(String, String, Object) |
Redirects (Status302Found) to the specified action using the specified
|
RedirectToAction(String, String, Object, String) |
Redirects (Status302Found) to the specified action using the specified |
RedirectToAction(String, String, String) |
Redirects (Status302Found) to the specified action using the specified
|
RedirectToActionPermanent(String) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanent(String, Object) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanent(String, String) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanent(String, String, Object) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanent(String, String, Object, String) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanent(String, String, String) |
Redirects (Status301MovedPermanently) to the specified action with
Permanent set to true using the specified |
RedirectToActionPermanentPreserveMethod(String, String, Object, String) |
Redirects (Status308PermanentRedirect) to the specified action with
Permanent set to true and PreserveMethod
set to true, using the specified |
RedirectToActionPreserveMethod(String, String, Object, String) |
Redirects (Status307TemporaryRedirect) to the specified action with
Permanent set to false and PreserveMethod
set to true, using the specified |
RedirectToPage(String) |
Redirects (Status302Found) to the specified |
RedirectToPage(String, Object) |
Redirects (Status302Found) to the specified |
RedirectToPage(String, String) |
Redirects (Status302Found) to the specified |
RedirectToPage(String, String, Object) |
Redirects (Status302Found) to the specified |
RedirectToPage(String, String, Object, String) |
Redirects (Status302Found) to the specified |
RedirectToPage(String, String, String) |
Redirects (Status302Found) to the specified |
RedirectToPagePermanent(String) |
Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, Object) |
Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String) |
Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String, Object, String) |
Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanent(String, String, String) |
Redirects (Status301MovedPermanently) to the specified |
RedirectToPagePermanentPreserveMethod(String, String, Object, String) |
Redirects (Status308PermanentRedirect) to the specified route with
Permanent set to true and PreserveMethod
set to true, using the specified |
RedirectToPagePreserveMethod(String, String, Object, String) |
Redirects (Status307TemporaryRedirect) to the specified page with
Permanent set to false and PreserveMethod
set to true, using the specified |
RedirectToRoute(Object) |
Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String) |
Redirects (Status302Found) to the specified route using the specified |
RedirectToRoute(String, Object) |
Redirects (Status302Found) to the specified route using the specified
|
RedirectToRoute(String, Object, String) |
Redirects (Status302Found) to the specified route using the specified
|
RedirectToRoute(String, String) |
Redirects (Status302Found) to the specified route using the specified
|
RedirectToRoutePermanent(Object) |
Redirects (Status301MovedPermanently) to the specified route with
Permanent set to true using the specified |
RedirectToRoutePermanent(String) |
Redirects (Status301MovedPermanently) to the specified route with
Permanent set to true using the specified |
RedirectToRoutePermanent(String, Object) |
Redirects (Status301MovedPermanently) to the specified route with
Permanent set to true using the specified |
RedirectToRoutePermanent(String, Object, String) |
Redirects (Status301MovedPermanently) to the specified route with
Permanent set to true using the specified |
RedirectToRoutePermanent(String, String) |
Redirects (Status301MovedPermanently) to the specified route with
Permanent set to true using the specified |
RedirectToRoutePermanentPreserveMethod(String, Object, String) |
Redirects (Status308PermanentRedirect) to the specified route with
Permanent set to true and PreserveMethod
set to true, using the specified |
RedirectToRoutePreserveMethod(String, Object, String) |
Redirects (Status307TemporaryRedirect) to the specified route with
Permanent set to false and PreserveMethod
set to true, using the specified |
SignIn(ClaimsPrincipal) |
Creates a SignInResult. (Inherited from ControllerBase) |
SignIn(ClaimsPrincipal, AuthenticationProperties) |
Creates a SignInResult with |
SignIn(ClaimsPrincipal, AuthenticationProperties, String) |
Creates a SignInResult with the specified specified authentication scheme and
|
SignIn(ClaimsPrincipal, AuthenticationProperties, String) |
Creates a SignInResult with the specified authentication scheme and
|
SignIn(ClaimsPrincipal, String) |
Creates a SignInResult with the specified authentication scheme. (Inherited from ControllerBase) |
SignOut() |
Creates a SignOutResult. (Inherited from ControllerBase) |
SignOut(AuthenticationProperties) |
Creates a SignOutResult with |
SignOut(AuthenticationProperties, String[]) |
Creates a SignOutResult with the specified authentication schemes and
|
SignOut(AuthenticationProperties, String[]) |
Creates a SignOutResult with the specified specified authentication schemes and
|
SignOut(String[]) |
Creates a SignOutResult with the specified authentication schemes. (Inherited from ControllerBase) |
StatusCode(Int32) |
Creates a StatusCodeResult object by specifying a |
StatusCode(Int32, Object) |
Creates a ObjectResult object by specifying a |
TryUpdateModelAsync(Object, Type, String) |
Updates the specified |
TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[]) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[]) |
Updates the specified |
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>) |
Updates the specified |
TryValidateModel(Object) |
Validates the specified |
TryValidateModel(Object, String) |
Validates the specified |
Unauthorized() |
Creates an UnauthorizedResult that produces an Status401Unauthorized response. (Inherited from ControllerBase) |
Unauthorized(Object) |
Creates an UnauthorizedObjectResult that produces a Status401Unauthorized response. (Inherited from ControllerBase) |
UnprocessableEntity() |
Creates an UnprocessableEntityResult that produces a Status422UnprocessableEntity response. (Inherited from ControllerBase) |
UnprocessableEntity(ModelStateDictionary) |
Creates an UnprocessableEntityObjectResult that produces a Status422UnprocessableEntity response. (Inherited from ControllerBase) |
UnprocessableEntity(Object) |
Creates an UnprocessableEntityObjectResult that produces a Status422UnprocessableEntity response. (Inherited from ControllerBase) |
ValidationProblem() |
Creates an ActionResult that produces a Status400BadRequest response with validation errors from ModelState. (Inherited from ControllerBase) |
ValidationProblem(ModelStateDictionary) |
Creates an ActionResult that produces a Status400BadRequest response
with validation errors from |
ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary) |
Creates an ActionResult that produces a Status400BadRequest response with a ValidationProblemDetails value. (Inherited from ControllerBase) |
ValidationProblem(ValidationProblemDetails) |
Creates an BadRequestObjectResult that produces a Status400BadRequest response. (Inherited from ControllerBase) |
View() |
Creates a ViewResult object that renders a view to the response. |
View(Object) |
Creates a ViewResult object by specifying a |
View(String) |
Creates a ViewResult object by specifying a |
View(String, Object) |
Creates a ViewResult object by specifying a |
ViewComponent(String) |
Creates a ViewComponentResult by specifying the name of a view component to render. |
ViewComponent(String, Object) |
Creates a ViewComponentResult by specifying the name of a view component to render. |
ViewComponent(Type) |
Creates a ViewComponentResult by specifying the Type of a view component to render. |
ViewComponent(Type, Object) |
Creates a ViewComponentResult by specifying the Type of a view component to render. |