HappyTravel.ErrorHandling/PublicProblemDetailsFactory.cs
/// <summary>
/// Creates a <see cref="ProblemDetails" /> instance that configures defaults based on values specified in <see cref="ApiBehaviorOptions" />.
/// </summary>
/// <param name="httpContext">The <see cref="HttpContext" />.</param>
/// <param name="statusCode">The value for <see cref="ProblemDetails.Status"/>.</param>
/// <param name="title">The value for <see cref="ProblemDetails.Title" />.</param>
/// <param name="detail">The value for <see cref="ProblemDetails.Detail" />.</param>
/// <param name="type">The value for <see cref="ProblemDetails.Type" />.</param>
/// <param name="instance">The value for <see cref="ProblemDetails.Instance" />.</param>
/// <returns>The <see cref="ProblemDetails"/> instance.</returns>
Creates a  instance that configures defaults based on values specified in .
Creates a instance that configures defaults based on values specified in .
public ProblemDetails CreateProblemDetails(HttpContext httpContext, HttpStatusCode statusCode, string title, string detail, string? type = null, string? instance = null)
        {
            if (title is null)
                throw new ArgumentNullException(nameof(title));
            if (detail is null)
                throw new ArgumentNullException(nameof(detail));
            return CreateProblemDetails(httpContext, (int) statusCode, title, type, detail, instance);
        }
public ProblemDetails CreateProblemDetails ( HttpContext httpContext , HttpStatusCode statusCode , string title , string detail , string ? type = null , string ? instance = null ) { if ( title is null ) throw new ArgumentNullException ( nameof ( title ) ) ; if ( detail is null ) throw new ArgumentNullException ( nameof ( detail ) ) ; return CreateProblemDetails ( httpContext , ( int ) statusCode , title , type , detail , instance ) ; }
Creates a  instance that configures defaults based on values specified in .
Creates a instance that configures defaults based on values specified in .
None
httpContext
HttpContext
None
statusCode
HttpStatusCode
The value for .
The value for .
title
string
The value for .
The value for .
detail
string
The value for .
The value for .
type
string?
The value for .
The value for .
instance
string?
The value for .
The value for .