From 02b2373453d7058be5048533aac44ccf69c78309 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 16 Oct 2023 10:41:48 +1300 Subject: [PATCH 1/2] Calls to SentryTracingBuilder can now be chained correctly --- src/Sentry.AspNetCore/SentryTracingBuilder.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Sentry.AspNetCore/SentryTracingBuilder.cs b/src/Sentry.AspNetCore/SentryTracingBuilder.cs index e34379f4c5..9713c44eca 100644 --- a/src/Sentry.AspNetCore/SentryTracingBuilder.cs +++ b/src/Sentry.AspNetCore/SentryTracingBuilder.cs @@ -51,11 +51,13 @@ public IApplicationBuilder Use(Func middleware var instrumenter = options?.Value.Instrumenter ?? Instrumenter.Sentry; if (instrumenter == Instrumenter.Sentry) { - return InnerBuilder.Use(middleware).UseSentryTracing(); + InnerBuilder.Use(middleware).UseSentryTracing(); + return this; // Make sure we return the same builder (not the inner builder), for chaining } this.StoreInstrumenter(instrumenter); // Saves us from having to resolve the options to make this check again } - return InnerBuilder.Use(middleware); + InnerBuilder.Use(middleware); + return this; // Make sure we return the same builder (not the inner builder), for chaining } } From cf9b727ac59cf58dfa01ba8465866615d20bf2f5 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 16 Oct 2023 10:54:04 +1300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 603d78489d..9d82176544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixes + +- Fixed chaining on the IApplicationBuilder for methods like UseRouting and UseEndpoints ([#2726](https://github.com/getsentry/sentry-dotnet/pull/2726)) + ### Dependencies - Bump Cocoa SDK from v8.13.0 to v8.13.1 ([#2722](https://github.com/getsentry/sentry-dotnet/pull/2722))