Share via


DefaultProblemDetailsFactory Class

Definition

The DefaultProblemDetailsFactory is a concrete implementation of the ProblemDetailsFactory abstract class. It provides methods to create instances of ProblemDetails and ValidationProblemDetails with default settings. This class uses the provided ApiBehaviorOptions for client error mapping and an optional custom configuration action to further customize the problem details.

public sealed class DefaultProblemDetailsFactory : Microsoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsFactory
type DefaultProblemDetailsFactory = class
    inherit ProblemDetailsFactory
Public NotInheritable Class DefaultProblemDetailsFactory
Inherits ProblemDetailsFactory
Inheritance
DefaultProblemDetailsFactory

Constructors

DefaultProblemDetailsFactory(IOptions<ApiBehaviorOptions>, IOptions<ProblemDetailsOptions>)

Initializes a new instance of the DefaultProblemDetailsFactory class.

Methods

CreateProblemDetails(HttpContext, Nullable<Int32>, String, String, String, String)

Creates a ProblemDetails instance that configures defaults based on values specified in ApiBehaviorOptions.

CreateValidationProblemDetails(HttpContext, ModelStateDictionary, Nullable<Int32>, String, String, String, String)

Creates a ValidationProblemDetails instance that configures defaults based on values specified in ApiBehaviorOptions.

Applies to