https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6586 - Migrated ExamineManagementController
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
|
||||
namespace Umbraco.Web.Common.Exceptions
|
||||
{
|
||||
@@ -14,6 +16,22 @@ namespace Umbraco.Web.Common.Exceptions
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public HttpResponseException(ActionResult actionResult)
|
||||
{
|
||||
|
||||
Status = actionResult switch
|
||||
{
|
||||
IStatusCodeActionResult x => (HttpStatusCode)x.StatusCode.GetValueOrDefault((int)HttpStatusCode.InternalServerError),
|
||||
_ => HttpStatusCode.InternalServerError
|
||||
};
|
||||
|
||||
Value = actionResult switch
|
||||
{
|
||||
ObjectResult x => x.Value,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
public HttpStatusCode Status { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user