Table of Contents

Class MvcFaultDescriptorOptions

Namespace
Cuemon.AspNetCore.Mvc.Filters.Diagnostics
Assembly
Cuemon.AspNetCore.Mvc.dll

Specifies options that is related to FaultDescriptorFilter operations.

public class MvcFaultDescriptorOptions : FaultDescriptorOptions, IAsyncOptions, IExceptionDescriptorOptions, IValidatableParameterObject, IParameterObject
Inheritance
MvcFaultDescriptorOptions
Implements
Inherited Members

Examples

The following example configures for Problem Details responses and marks MVC exceptions as handled after the filter runs.

using System;
using Cuemon.AspNetCore.Diagnostics;
using Cuemon.AspNetCore.Mvc.Filters.Diagnostics;
using Cuemon.Diagnostics;
namespace MyApp.Examples;

public static class MvcFaultDescriptorOptionsExample
{
    public static void Demonstrate()
    {
        var options = new MvcFaultDescriptorOptions
        {
            MarkExceptionHandled = true,
            FaultDescriptor = PreferredFaultDescriptor.ProblemDetails,
            SensitivityDetails = FaultSensitivityDetails.Failure
        };

        Console.WriteLine(options.MarkExceptionHandled);
        Console.WriteLine(options.FaultDescriptor);
        Console.WriteLine(options.HttpFaultResolvers.Count);
    }
}

Constructors

MvcFaultDescriptorOptions()

Initializes a new instance of the MvcFaultDescriptorOptions class.

public MvcFaultDescriptorOptions()

Remarks

The following table shows the initial property values for an instance of MvcFaultDescriptorOptions.

PropertyInitial Value
MarkExceptionHandledfalse

Properties

MarkExceptionHandled

Gets or sets a value indicating whether to mark ASP.NET Core MVC ExceptionHandled to true.

public bool MarkExceptionHandled { get; set; }

Property Value

bool

true if ExceptionHandled should be set; otherwise, false.

See Also