1
- // Licensed to the .NET Foundation under one or more agreements.
1
+ // Load this only for .NET 8.
2
+ #if ! NET9_0_OR_GREATER
3
+ // Licensed to the .NET Foundation under one or more agreements.
2
4
// The .NET Foundation licenses this file to you under the MIT license.
3
5
4
6
using Microsoft . AspNetCore . Http ;
@@ -100,43 +102,4 @@ private void ApplyProblemDetailsDefaults(HttpContext httpContext, ProblemDetails
100
102
_configure ? . Invoke ( new ( ) { HttpContext = httpContext ! , ProblemDetails = problemDetails } ) ;
101
103
}
102
104
}
103
-
104
- #if NET6_0
105
- public class ProblemDetailsOptions
106
- {
107
- /// <summary>
108
- /// The operation that customizes the current <see cref="Mvc.ProblemDetails"/> instance.
109
- /// </summary>
110
- public Action < ProblemDetailsContext > ? CustomizeProblemDetails { get ; set ; }
111
- }
112
-
113
- public class ProblemDetailsContext
114
- {
115
- private ProblemDetails ? _problemDetails ;
116
-
117
- /// <summary>
118
- /// The <see cref="HttpContext"/> associated with the current request being processed by the filter.
119
- /// </summary>
120
- public HttpContext ? HttpContext { get ; init ; }
121
-
122
- /// <summary>
123
- /// A collection of additional arbitrary metadata associated with the current request endpoint.
124
- /// </summary>
125
- public EndpointMetadataCollection ? AdditionalMetadata { get ; init ; }
126
-
127
- /// <summary>
128
- /// An instance of <see cref="ProblemDetails"/> that will be
129
- /// used during the response payload generation.
130
- /// </summary>
131
- public ProblemDetails ProblemDetails
132
- {
133
- get => _problemDetails ??= new ProblemDetails ( ) ;
134
- set => _problemDetails = value ;
135
- }
136
-
137
- /// <summary>
138
- /// The exception causing the problem or <c>null</c> if no exception information is available.
139
- /// </summary>
140
- public Exception ? Exception { get ; init ; }
141
- }
142
- #endif
105
+ #endif
0 commit comments