Horje
ExecuteResultAsync Code Example
ExecuteResultAsync
public class TestResult
{
    public Exception Exception { get; set; }
    public object Data { get; set; }
}

public class TestActionResult : IActionResult
{
    private readonly TestResult _result;

    public TestActionResult(TestResult result)
    {
        _result = result;
    }

    public async Task ExecuteResultAsync(ActionContext context)
    {
        var objectResult = new ObjectResult(_result.Exception ?? _result.Data)
        {
            StatusCode = _result.Exception != null
                ? StatusCodes.Status500InternalServerError
                : StatusCodes.Status200OK
        };

        await objectResult.ExecuteResultAsync(context);
    }
}




Csharp

Related
unity break if statement Code Example unity break if statement Code Example
car Code Example car Code Example
c# is not Code Example c# is not Code Example
dispathcer in wpf stack overflow Code Example dispathcer in wpf stack overflow Code Example
how do make internet Code Example how do make internet Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11