#pragma warning disable SA1648 // inheritdoc should be used with inheriting class /// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="ProblemDetailsContent" /> class for the provided <see cref="IHttpProblemDetails" />. /// </summary> /// <param name="problemDetails">The <see cref="IHttpProblemDetails" /> to build the <see cref="ProblemDetailsContent" /> from.</param> /// <param name="serializationMethod">The method to write a JSON representation of the provided <see cref="IHttpProblemDetails"/> into a <see cref="Stream"/>.</param> public ProblemDetailsContent(IHttpProblemDetails problemDetails, SerializeHttpProblemDetailsJsonToStream serializationMethod) { ProblemDetails = problemDetails; _memoryStream = new MemoryStream(); serializationMethod(problemDetails, _memoryStream).Wait(); Headers.ContentType = MediaTypeHeaderValue.Parse("application/problem+json"); }
#pragma warning disable SA1648 // inheritdoc should be used with inheriting class /// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="HttpProblemDetailsException"/> class with <see cref="HttpProblemDetails"/>, an <see cref="Exception"/> message, and an inner <see cref="Exception"/>. /// </summary> /// <param name="problemDetails">The <see cref="IHttpProblemDetails"/> explaining what caused the <see cref="HttpProblemDetailsException"/> to be thrown.</param> /// <param name="message">A message providing additional details for the exception, and why it was thrown (unlike <paramref name="problemDetails"/> members, this will not be sent to the user).</param> /// <param name="innerException">An inner exception responsible for this one being thrown.</param> public HttpProblemDetailsException(IHttpProblemDetails problemDetails, string message, Exception innerException) : base(message, innerException) => ProblemDetails = problemDetails;