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="problemDetails">The existing instance of <see cref="ProblemDetails" />.</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, ProblemDetails problemDetails, int? statusCode = null, string? title = null)
        {
            statusCode ??= problemDetails.Status;
            title ??= problemDetails.Title;
            var newProblemDetails = CreateProblemDetails(httpContext, statusCode, title, problemDetails.Type, problemDetails.Detail);
            return AddExtensions(newProblemDetails, problemDetails.Extensions.Select(kvp => (kvp.Key, kvp.Value)));
        }
public ProblemDetails CreateProblemDetails ( HttpContext httpContext , ProblemDetails problemDetails , int ? statusCode = null , string ? title = null ) { statusCode ??= problemDetails . Status ; title ??= problemDetails . Title ; var newProblemDetails = CreateProblemDetails ( httpContext , statusCode , title , problemDetails . Type , problemDetails . Detail ) ; return AddExtensions ( newProblemDetails , problemDetails . Extensions . Select ( kvp => ( kvp . Key , kvp . Value ) ) ) ; }
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
problemDetails
ProblemDetails
The existing instance of .
The existing instance of .
statusCode
int?
The value for .
The value for .
title
string?
The value for .
The value for .