File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
fundamentals/middleware/problem-details-service Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1- #define API_CONTROLLER // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT
1+ #define DISABLE // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT DISABLE
22#if NEVER
33#elif MIDDLEWARE
44// <snippet_middleware>
@@ -169,7 +169,6 @@ await problemDetailsService.WriteAsync(new ProblemDetailsContext
169169
170170app . Run ( ) ;
171171// </snippet_default>
172-
173172#elif MIN_API
174173// <snippet_min_api>
175174var builder = WebApplication . CreateBuilder ( args ) ;
@@ -245,4 +244,24 @@ await problemDetailsService.WriteAsync(new ProblemDetailsContext
245244
246245app . Run ( ) ;
247246// </snippet_min_api>
247+ #elif DISABLE
248+ // <snippet_disable>
249+ var builder = WebApplication . CreateBuilder ( args ) ;
250+
251+ builder . Services . AddControllers ( )
252+ . ConfigureApiBehaviorOptions ( options =>
253+ {
254+ options . SuppressMapClientErrors = true ;
255+ } ) ;
256+
257+ var app = builder . Build ( ) ;
258+
259+ app . UseHttpsRedirection ( ) ;
260+
261+ app . UseAuthorization ( ) ;
262+
263+ app . MapControllers ( ) ;
264+
265+ app . Run ( ) ;
266+ // </snippet_disable>
248267#endif
You can’t perform that action at this time.
0 commit comments