@@ -41,6 +41,17 @@ public static IWebHostBuilder UseSentry(this IWebHostBuilder builder, string dsn
4141 public static IWebHostBuilder UseSentry (
4242 this IWebHostBuilder builder ,
4343 Action < SentryAspNetCoreOptions > configureOptions )
44+ => builder . UseSentry ( ( context , options ) => configureOptions ? . Invoke ( options ) ) ;
45+
46+ /// <summary>
47+ /// Uses Sentry integration.
48+ /// </summary>
49+ /// <param name="builder">The builder.</param>
50+ /// <param name="configureOptions">The configure options.</param>
51+ /// <returns></returns>
52+ public static IWebHostBuilder UseSentry (
53+ this IWebHostBuilder builder ,
54+ Action < WebHostBuilderContext , SentryAspNetCoreOptions > configureOptions )
4455 {
4556 // The earliest we can hook the SDK initialization code with the framework
4657 // Initialization happens at a later time depending if the default MEL backend is enabled or not.
@@ -54,7 +65,10 @@ public static IWebHostBuilder UseSentry(
5465
5566 if ( configureOptions != null )
5667 {
57- logging . Services . Configure ( configureOptions ) ;
68+ logging . Services . Configure < SentryAspNetCoreOptions > ( options =>
69+ {
70+ configureOptions ( context , options ) ;
71+ } ) ;
5872 }
5973
6074 logging . Services . AddSingleton < IConfigureOptions < SentryAspNetCoreOptions > , SentryAspNetCoreOptionsSetup > ( ) ;
0 commit comments