Skip to content

Commit 3bf408c

Browse files
bouwkastandrewlock
andauthored
Use DuckCast instead of TryDuckCast
Co-authored-by: Andrew Lock <[email protected]>
1 parent 9061a6c commit 3bf408c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tracer/src/Datadog.Trace/DiagnosticListeners/AspNetCoreDiagnosticObserver.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,7 @@ private void OnHostingHttpRequestInStop(object arg)
754754
return;
755755
}
756756

757-
if (arg.TryDuckCast<HttpRequestInStopStruct>(out var stopStruct)
758-
&& stopStruct.HttpContext is { } httpContext
757+
if (arg.DuckCast<HttpRequestInStopStruct>()?.HttpContext is { } httpContext
759758
&& httpContext.Features.Get<AspNetCoreHttpRequestHandler.RequestTrackingFeature>() is { RootScope: { } rootScope })
760759
{
761760
AspNetCoreRequestHandler.StopAspNetCorePipelineScope(tracer, CurrentSecurity, rootScope, httpContext);

0 commit comments

Comments
 (0)