File tree Expand file tree Collapse file tree
ManagedCode.Communication.Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66using Microsoft . AspNetCore . WebUtilities ;
77using Microsoft . Extensions . DependencyInjection ;
88using Microsoft . Extensions . Hosting ;
9- using ManagedCode . Communication . Extensions . Constants ;
9+ using static ManagedCode . Communication . Extensions . Constants . ProblemConstants ;
1010
1111namespace ManagedCode . Communication . Extensions . Extensions ;
1212
@@ -50,22 +50,13 @@ public static IServiceCollection AddDefaultProblemDetails(this IServiceCollectio
5050 context . ProblemDetails . Type ??= $ "https://httpstatuses.io/{ statusCode } ";
5151 context . ProblemDetails . Title ??= ReasonPhrases . GetReasonPhrase ( statusCode ) ;
5252 context . ProblemDetails . Instance ??= context . HttpContext . Request . Path ;
53- context . ProblemDetails . Extensions . TryAdd ( ProblemConstants . ExtensionKeys . TraceId , Activity . Current ? . Id ?? context . HttpContext . TraceIdentifier ) ;
53+ context . ProblemDetails . Extensions . TryAdd ( ExtensionKeys . TraceId , Activity . Current ? . Id ?? context . HttpContext . TraceIdentifier ) ;
5454 } ;
5555 } ) ;
5656
5757 return services ;
5858 }
5959
60- public static IServiceCollection AddCommunicationExceptionHandler ( this IServiceCollection services )
61- {
62- // Ensures that the ProblemDetails service is registered.
63- services . AddProblemDetails ( ) ;
64-
65- services . AddExceptionHandler < CommunicationExceptionHandler > ( ) ;
66- return services ;
67- }
68-
6960 public static IServiceCollection AddCommunicationFilters < TExceptionFilter , TModelValidationFilter , THubExceptionFilter > (
7061 this IServiceCollection services )
7162 where TExceptionFilter : ExceptionFilterBase
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments