ControllerBase helpers refactored with lambda syntax.
- Addresses #6864
This commit is contained in:
parent
7f214492b8
commit
324db455d9
|
|
@ -201,9 +201,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="StatusCodeResult"/> object for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual StatusCodeResult StatusCode(int statusCode)
|
||||
{
|
||||
return new StatusCodeResult(statusCode);
|
||||
}
|
||||
=> new StatusCodeResult(statusCode);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ObjectResult"/> object by specifying a <paramref name="statusCode"/> and <paramref name="value"/>
|
||||
|
|
@ -228,9 +226,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="ContentResult"/> object for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual ContentResult Content(string content)
|
||||
{
|
||||
return Content(content, (MediaTypeHeaderValue)null);
|
||||
}
|
||||
=> Content(content, (MediaTypeHeaderValue)null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
|
||||
|
|
@ -241,9 +237,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="ContentResult"/> object for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual ContentResult Content(string content, string contentType)
|
||||
{
|
||||
return Content(content, MediaTypeHeaderValue.Parse(contentType));
|
||||
}
|
||||
=> Content(content, MediaTypeHeaderValue.Parse(contentType));
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
|
||||
|
|
@ -291,9 +285,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="NoContentResult"/> object for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual NoContentResult NoContent()
|
||||
{
|
||||
return new NoContentResult();
|
||||
}
|
||||
=> new NoContentResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="OkResult"/> object that produces an empty <see cref="StatusCodes.Status200OK"/> response.
|
||||
|
|
@ -301,9 +293,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="OkResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual OkResult Ok()
|
||||
{
|
||||
return new OkResult();
|
||||
}
|
||||
=> new OkResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="OkObjectResult"/> object that produces an <see cref="StatusCodes.Status200OK"/> response.
|
||||
|
|
@ -312,9 +302,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="OkObjectResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual OkObjectResult Ok(object value)
|
||||
{
|
||||
return new OkObjectResult(value);
|
||||
}
|
||||
=> new OkObjectResult(value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="RedirectResult"/> object that redirects (<see cref="StatusCodes.Status302Found"/>)
|
||||
|
|
@ -482,9 +470,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// </example>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToAction()
|
||||
{
|
||||
return RedirectToAction(actionName: null);
|
||||
}
|
||||
=> RedirectToAction(actionName: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the <paramref name="actionName"/>.
|
||||
|
|
@ -493,9 +479,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToAction(string actionName)
|
||||
{
|
||||
return RedirectToAction(actionName, routeValues: null);
|
||||
}
|
||||
=> RedirectToAction(actionName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
|
||||
|
|
@ -506,9 +490,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToAction(string actionName, object routeValues)
|
||||
{
|
||||
return RedirectToAction(actionName, controllerName: null, routeValues: routeValues);
|
||||
}
|
||||
=> RedirectToAction(actionName, controllerName: null, routeValues: routeValues);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
|
||||
|
|
@ -519,9 +501,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToAction(string actionName, string controllerName)
|
||||
{
|
||||
return RedirectToAction(actionName, controllerName, routeValues: null);
|
||||
}
|
||||
=> RedirectToAction(actionName, controllerName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the specified
|
||||
|
|
@ -536,9 +516,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string actionName,
|
||||
string controllerName,
|
||||
object routeValues)
|
||||
{
|
||||
return RedirectToAction(actionName, controllerName, routeValues, fragment: null);
|
||||
}
|
||||
=> RedirectToAction(actionName, controllerName, routeValues, fragment: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the specified
|
||||
|
|
@ -553,9 +531,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string actionName,
|
||||
string controllerName,
|
||||
string fragment)
|
||||
{
|
||||
return RedirectToAction(actionName, controllerName, routeValues: null, fragment: fragment);
|
||||
}
|
||||
=> RedirectToAction(actionName, controllerName, routeValues: null, fragment: fragment);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the specified <paramref name="actionName"/>,
|
||||
|
|
@ -617,9 +593,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToActionPermanent(string actionName)
|
||||
{
|
||||
return RedirectToActionPermanent(actionName, routeValues: null);
|
||||
}
|
||||
=> RedirectToActionPermanent(actionName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
|
||||
|
|
@ -631,9 +605,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToActionPermanent(string actionName, object routeValues)
|
||||
{
|
||||
return RedirectToActionPermanent(actionName, controllerName: null, routeValues: routeValues);
|
||||
}
|
||||
=> RedirectToActionPermanent(actionName, controllerName: null, routeValues: routeValues);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
|
||||
|
|
@ -645,9 +617,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToActionResult RedirectToActionPermanent(string actionName, string controllerName)
|
||||
{
|
||||
return RedirectToActionPermanent(actionName, controllerName, routeValues: null);
|
||||
}
|
||||
=> RedirectToActionPermanent(actionName, controllerName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
|
||||
|
|
@ -663,9 +633,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string actionName,
|
||||
string controllerName,
|
||||
string fragment)
|
||||
{
|
||||
return RedirectToActionPermanent(actionName, controllerName, routeValues: null, fragment: fragment);
|
||||
}
|
||||
=> RedirectToActionPermanent(actionName, controllerName, routeValues: null, fragment: fragment);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
|
||||
|
|
@ -681,9 +649,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string actionName,
|
||||
string controllerName,
|
||||
object routeValues)
|
||||
{
|
||||
return RedirectToActionPermanent(actionName, controllerName, routeValues, fragment: null);
|
||||
}
|
||||
=> RedirectToActionPermanent(actionName, controllerName, routeValues, fragment: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
|
||||
|
|
@ -750,9 +716,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoute(string routeName)
|
||||
{
|
||||
return RedirectToRoute(routeName, routeValues: null);
|
||||
}
|
||||
=> RedirectToRoute(routeName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified route using the specified <paramref name="routeValues"/>.
|
||||
|
|
@ -761,9 +725,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoute(object routeValues)
|
||||
{
|
||||
return RedirectToRoute(routeName: null, routeValues: routeValues);
|
||||
}
|
||||
=> RedirectToRoute(routeName: null, routeValues: routeValues);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified route using the specified
|
||||
|
|
@ -774,9 +736,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoute(string routeName, object routeValues)
|
||||
{
|
||||
return RedirectToRoute(routeName, routeValues, fragment: null);
|
||||
}
|
||||
=> RedirectToRoute(routeName, routeValues, fragment: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified route using the specified
|
||||
|
|
@ -787,9 +747,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoute(string routeName, string fragment)
|
||||
{
|
||||
return RedirectToRoute(routeName, routeValues: null, fragment: fragment);
|
||||
}
|
||||
=> RedirectToRoute(routeName, routeValues: null, fragment: fragment);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified route using the specified
|
||||
|
|
@ -845,9 +803,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoutePermanent(string routeName)
|
||||
{
|
||||
return RedirectToRoutePermanent(routeName, routeValues: null);
|
||||
}
|
||||
=> RedirectToRoutePermanent(routeName, routeValues: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
|
||||
|
|
@ -857,9 +813,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoutePermanent(object routeValues)
|
||||
{
|
||||
return RedirectToRoutePermanent(routeName: null, routeValues: routeValues);
|
||||
}
|
||||
=> RedirectToRoutePermanent(routeName: null, routeValues: routeValues);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
|
||||
|
|
@ -871,9 +825,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoutePermanent(string routeName, object routeValues)
|
||||
{
|
||||
return RedirectToRoutePermanent(routeName, routeValues, fragment: null);
|
||||
}
|
||||
=> RedirectToRoutePermanent(routeName, routeValues, fragment: null);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
|
||||
|
|
@ -885,9 +837,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual RedirectToRouteResult RedirectToRoutePermanent(string routeName, string fragment)
|
||||
{
|
||||
return RedirectToRoutePermanent(routeName, routeValues: null, fragment: fragment);
|
||||
}
|
||||
=> RedirectToRoutePermanent(routeName, routeValues: null, fragment: fragment);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
|
||||
|
|
@ -1061,9 +1011,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string pageHandler,
|
||||
object routeValues,
|
||||
string fragment)
|
||||
{
|
||||
return new RedirectToPageResult(pageName, pageHandler, routeValues, permanent: true, fragment: fragment);
|
||||
}
|
||||
=> new RedirectToPageResult(pageName, pageHandler, routeValues, permanent: true, fragment: fragment);
|
||||
|
||||
/// <summary>
|
||||
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified page with
|
||||
|
|
@ -1138,9 +1086,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="FileContentResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual FileContentResult File(byte[] fileContents, string contentType)
|
||||
{
|
||||
return File(fileContents, contentType, fileDownloadName: null);
|
||||
}
|
||||
=> File(fileContents, contentType, fileDownloadName: null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a file with the specified <paramref name="fileContents" /> as content (<see cref="StatusCodes.Status200OK"/>), the
|
||||
|
|
@ -1154,9 +1100,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="FileContentResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName)
|
||||
{
|
||||
return new FileContentResult(fileContents, contentType) { FileDownloadName = fileDownloadName };
|
||||
}
|
||||
=> new FileContentResult(fileContents, contentType) { FileDownloadName = fileDownloadName };
|
||||
|
||||
/// <summary>
|
||||
/// Returns a file with the specified <paramref name="fileContents" /> as content (<see cref="StatusCodes.Status200OK"/>),
|
||||
|
|
@ -1213,9 +1157,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="FileStreamResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual FileStreamResult File(Stream fileStream, string contentType)
|
||||
{
|
||||
return File(fileStream, contentType, fileDownloadName: null);
|
||||
}
|
||||
=> File(fileStream, contentType, fileDownloadName: null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a file in the specified <paramref name="fileStream" /> (<see cref="StatusCodes.Status200OK"/>) with the
|
||||
|
|
@ -1230,9 +1172,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="FileStreamResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName)
|
||||
{
|
||||
return new FileStreamResult(fileStream, contentType) { FileDownloadName = fileDownloadName };
|
||||
}
|
||||
=> new FileStreamResult(fileStream, contentType) { FileDownloadName = fileDownloadName };
|
||||
|
||||
/// <summary>
|
||||
/// Returns a file in the specified <paramref name="fileStream" /> (<see cref="StatusCodes.Status200OK"/>),
|
||||
|
|
@ -1289,9 +1229,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="VirtualFileResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual VirtualFileResult File(string virtualPath, string contentType)
|
||||
{
|
||||
return File(virtualPath, contentType, fileDownloadName: null);
|
||||
}
|
||||
=> File(virtualPath, contentType, fileDownloadName: null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file specified by <paramref name="virtualPath" /> (<see cref="StatusCodes.Status200OK"/>) with the
|
||||
|
|
@ -1306,9 +1244,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="VirtualFileResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual VirtualFileResult File(string virtualPath, string contentType, string fileDownloadName)
|
||||
{
|
||||
return new VirtualFileResult(virtualPath, contentType) { FileDownloadName = fileDownloadName };
|
||||
}
|
||||
=> new VirtualFileResult(virtualPath, contentType) { FileDownloadName = fileDownloadName };
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file specified by <paramref name="virtualPath" /> (<see cref="StatusCodes.Status200OK"/>), and the
|
||||
|
|
@ -1365,9 +1301,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="PhysicalFileResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual PhysicalFileResult PhysicalFile(string physicalPath, string contentType)
|
||||
{
|
||||
return PhysicalFile(physicalPath, contentType, fileDownloadName: null);
|
||||
}
|
||||
=> PhysicalFile(physicalPath, contentType, fileDownloadName: null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file specified by <paramref name="physicalPath" /> (<see cref="StatusCodes.Status200OK"/>) with the
|
||||
|
|
@ -1385,9 +1319,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string physicalPath,
|
||||
string contentType,
|
||||
string fileDownloadName)
|
||||
{
|
||||
return new PhysicalFileResult(physicalPath, contentType) { FileDownloadName = fileDownloadName };
|
||||
}
|
||||
=> new PhysicalFileResult(physicalPath, contentType) { FileDownloadName = fileDownloadName };
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file specified by <paramref name="physicalPath" /> (<see cref="StatusCodes.Status200OK"/>), and
|
||||
|
|
@ -1439,9 +1371,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="UnauthorizedResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual UnauthorizedResult Unauthorized()
|
||||
{
|
||||
return new UnauthorizedResult();
|
||||
}
|
||||
=> new UnauthorizedResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="NotFoundResult"/> that produces a <see cref="StatusCodes.Status404NotFound"/> response.
|
||||
|
|
@ -1449,9 +1379,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="NotFoundResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual NotFoundResult NotFound()
|
||||
{
|
||||
return new NotFoundResult();
|
||||
}
|
||||
=> new NotFoundResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="NotFoundObjectResult"/> that produces a <see cref="StatusCodes.Status404NotFound"/> response.
|
||||
|
|
@ -1459,9 +1387,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="NotFoundObjectResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual NotFoundObjectResult NotFound(object value)
|
||||
{
|
||||
return new NotFoundObjectResult(value);
|
||||
}
|
||||
=> new NotFoundObjectResult(value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="BadRequestResult"/> that produces a <see cref="StatusCodes.Status400BadRequest"/> response.
|
||||
|
|
@ -1469,9 +1395,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="BadRequestResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual BadRequestResult BadRequest()
|
||||
{
|
||||
return new BadRequestResult();
|
||||
}
|
||||
=> new BadRequestResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="BadRequestObjectResult"/> that produces a <see cref="StatusCodes.Status400BadRequest"/> response.
|
||||
|
|
@ -1479,9 +1403,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="BadRequestObjectResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual BadRequestObjectResult BadRequest(object error)
|
||||
{
|
||||
return new BadRequestObjectResult(error);
|
||||
}
|
||||
=> new BadRequestObjectResult(error);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="BadRequestObjectResult"/> that produces a <see cref="StatusCodes.Status400BadRequest"/> response.
|
||||
|
|
@ -1583,9 +1505,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="CreatedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual CreatedAtActionResult CreatedAtAction(string actionName, object value)
|
||||
{
|
||||
return CreatedAtAction(actionName, routeValues: null, value: value);
|
||||
}
|
||||
=> CreatedAtAction(actionName, routeValues: null, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CreatedAtActionResult"/> object that produces a <see cref="StatusCodes.Status201Created"/> response.
|
||||
|
|
@ -1596,9 +1516,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="CreatedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual CreatedAtActionResult CreatedAtAction(string actionName, object routeValues, object value)
|
||||
{
|
||||
return CreatedAtAction(actionName, controllerName: null, routeValues: routeValues, value: value);
|
||||
}
|
||||
=> CreatedAtAction(actionName, controllerName: null, routeValues: routeValues, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CreatedAtActionResult"/> object that produces a <see cref="StatusCodes.Status201Created"/> response.
|
||||
|
|
@ -1614,9 +1532,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string controllerName,
|
||||
object routeValues,
|
||||
object value)
|
||||
{
|
||||
return new CreatedAtActionResult(actionName, controllerName, routeValues, value);
|
||||
}
|
||||
=> new CreatedAtActionResult(actionName, controllerName, routeValues, value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CreatedAtRouteResult"/> object that produces a <see cref="StatusCodes.Status201Created"/> response.
|
||||
|
|
@ -1626,9 +1542,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="CreatedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual CreatedAtRouteResult CreatedAtRoute(string routeName, object value)
|
||||
{
|
||||
return CreatedAtRoute(routeName, routeValues: null, value: value);
|
||||
}
|
||||
=> CreatedAtRoute(routeName, routeValues: null, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CreatedAtRouteResult"/> object that produces a <see cref="StatusCodes.Status201Created"/> response.
|
||||
|
|
@ -1638,9 +1552,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="CreatedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual CreatedAtRouteResult CreatedAtRoute(object routeValues, object value)
|
||||
{
|
||||
return CreatedAtRoute(routeName: null, routeValues: routeValues, value: value);
|
||||
}
|
||||
=> CreatedAtRoute(routeName: null, routeValues: routeValues, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CreatedAtRouteResult"/> object that produces a <see cref="StatusCodes.Status201Created"/> response.
|
||||
|
|
@ -1651,9 +1563,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="CreatedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual CreatedAtRouteResult CreatedAtRoute(string routeName, object routeValues, object value)
|
||||
{
|
||||
return new CreatedAtRouteResult(routeName, routeValues, value);
|
||||
}
|
||||
=> new CreatedAtRouteResult(routeName, routeValues, value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1661,9 +1571,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedResult Accepted()
|
||||
{
|
||||
return new AcceptedResult();
|
||||
}
|
||||
=> new AcceptedResult();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1672,9 +1580,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedResult Accepted(object value)
|
||||
{
|
||||
return new AcceptedResult(location: null, value: value);
|
||||
}
|
||||
=> new AcceptedResult(location: null, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1701,9 +1607,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedResult Accepted(string uri)
|
||||
{
|
||||
return new AcceptedResult(location: uri, value: null);
|
||||
}
|
||||
=> new AcceptedResult(location: uri, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1713,9 +1617,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedResult Accepted(string uri, object value)
|
||||
{
|
||||
return new AcceptedResult(uri, value);
|
||||
}
|
||||
=> new AcceptedResult(uri, value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1741,9 +1643,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtActionResult AcceptedAtAction(string actionName)
|
||||
{
|
||||
return AcceptedAtAction(actionName, routeValues: null, value: null);
|
||||
}
|
||||
=> AcceptedAtAction(actionName, routeValues: null, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtActionResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1753,9 +1653,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtActionResult AcceptedAtAction(string actionName, string controllerName)
|
||||
{
|
||||
return AcceptedAtAction(actionName, controllerName, routeValues: null, value: null);
|
||||
}
|
||||
=> AcceptedAtAction(actionName, controllerName, routeValues: null, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtActionResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1765,9 +1663,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtActionResult AcceptedAtAction(string actionName, object value)
|
||||
{
|
||||
return AcceptedAtAction(actionName, routeValues: null, value: value);
|
||||
}
|
||||
=> AcceptedAtAction(actionName, routeValues: null, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtActionResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1778,9 +1674,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtActionResult AcceptedAtAction(string actionName, string controllerName, object routeValues)
|
||||
{
|
||||
return AcceptedAtAction(actionName, controllerName, routeValues, value: null);
|
||||
}
|
||||
=> AcceptedAtAction(actionName, controllerName, routeValues, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtActionResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1791,9 +1685,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtActionResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtActionResult AcceptedAtAction(string actionName, object routeValues, object value)
|
||||
{
|
||||
return AcceptedAtAction(actionName, controllerName: null, routeValues: routeValues, value: value);
|
||||
}
|
||||
=> AcceptedAtAction(actionName, controllerName: null, routeValues: routeValues, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtActionResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1809,9 +1701,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
string controllerName,
|
||||
object routeValues,
|
||||
object value)
|
||||
{
|
||||
return new AcceptedAtActionResult(actionName, controllerName, routeValues, value);
|
||||
}
|
||||
=> new AcceptedAtActionResult(actionName, controllerName, routeValues, value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtRouteResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1820,9 +1710,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtRouteResult AcceptedAtRoute(object routeValues)
|
||||
{
|
||||
return AcceptedAtRoute(routeName: null, routeValues: routeValues, value: null);
|
||||
}
|
||||
=> AcceptedAtRoute(routeName: null, routeValues: routeValues, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtRouteResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1831,9 +1719,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtRouteResult AcceptedAtRoute(string routeName)
|
||||
{
|
||||
return AcceptedAtRoute(routeName, routeValues: null, value: null);
|
||||
}
|
||||
=> AcceptedAtRoute(routeName, routeValues: null, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtRouteResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1843,9 +1729,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtRouteResult AcceptedAtRoute(string routeName, object routeValues)
|
||||
{
|
||||
return AcceptedAtRoute(routeName, routeValues, value: null);
|
||||
}
|
||||
=> AcceptedAtRoute(routeName, routeValues, value: null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtRouteResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1855,9 +1739,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtRouteResult AcceptedAtRoute(object routeValues, object value)
|
||||
{
|
||||
return AcceptedAtRoute(routeName: null, routeValues: routeValues, value: value);
|
||||
}
|
||||
=> AcceptedAtRoute(routeName: null, routeValues: routeValues, value: value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="AcceptedAtRouteResult"/> object that produces an <see cref="StatusCodes.Status202Accepted"/> response.
|
||||
|
|
@ -1868,9 +1750,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <returns>The created <see cref="AcceptedAtRouteResult"/> for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual AcceptedAtRouteResult AcceptedAtRoute(string routeName, object routeValues, object value)
|
||||
{
|
||||
return new AcceptedAtRouteResult(routeName, routeValues, value);
|
||||
}
|
||||
=> new AcceptedAtRouteResult(routeName, routeValues, value);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ChallengeResult"/>.
|
||||
|
|
|
|||
Loading…
Reference in New Issue