27 lines
725 B
C#
27 lines
725 B
C#
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.DataProtection.Internal;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace OD.WebApplication.Models
|
|
{
|
|
public class ErrorMessageResult : IActionResult
|
|
{
|
|
private readonly ErrorResult _result;
|
|
|
|
public ErrorMessageResult(ErrorResult result)
|
|
{
|
|
_result = result;
|
|
}
|
|
|
|
public async Task ExecuteResultAsync(ActionContext context)
|
|
{
|
|
var objectResult = new ObjectResult(_result.Exception)
|
|
{
|
|
StatusCode = StatusCodes.Status500InternalServerError
|
|
};
|
|
|
|
await objectResult.ExecuteResultAsync(context);
|
|
}
|
|
}
|
|
} |