[Fixes #6902] Added an overload for StatusCode that takes in System.Net.HttpStatusCode
This commit is contained in:
parent
ce66e95304
commit
c567a690bc
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -202,6 +203,15 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
[NonAction]
|
||||
public virtual StatusCodeResult StatusCode(int statusCode)
|
||||
=> new StatusCodeResult(statusCode);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="StatusCodeResult"/> object by specifying a <paramref name="statusCode"/>.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">The status code to set on the response.</param>
|
||||
/// <returns>The created <see cref="StatusCodeResult"/> object for the response.</returns>
|
||||
[NonAction]
|
||||
public virtual StatusCodeResult StatusCode(HttpStatusCode statusCode)
|
||||
=> StatusCode((int)statusCode);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ObjectResult"/> object by specifying a <paramref name="statusCode"/> and <paramref name="value"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue