Skip to content

Commit bd3f2f9

Browse files
committed
Add back AOT attributes and docs
1 parent d5e3281 commit bd3f2f9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Sentry.Maui/SentryMauiAppBuilder.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ namespace Sentry.Maui;
55
/// </summary>
66
public class SentryMauiAppBuilder(IServiceCollection services)
77
{
8+
/// <summary>
9+
/// Access the current service collection
10+
/// </summary>
811
public IServiceCollection Services => services;
912

1013
/// <summary>
1114
/// Configures the application by adding a binding for a Maui element of the specified implementation type.
1215
/// </summary>
13-
/// <typeparam name="TImpl">The type of implementation for the Maui element binder to be added.</typeparam>
16+
/// <typeparam name="TEventBinder">The type of implementation for the Maui element binder to be added.</typeparam>
1417
/// <returns>The current instance of <see cref="SentryMauiAppBuilder"/> to allow method chaining.</returns>
15-
public SentryMauiAppBuilder AddMauiElementBinder<TImpl>() where TImpl : class, IMauiElementEventBinder
18+
public SentryMauiAppBuilder AddMauiElementBinder<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TEventBinder>() where TEventBinder : class, IMauiElementEventBinder
1619
{
17-
services.AddSingleton<IMauiElementEventBinder, TImpl>();
20+
Services.AddSingleton<IMauiElementEventBinder, TEventBinder>();
1821
return this;
1922
}
2023
}

src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static MauiAppBuilder UseSentry(this MauiAppBuilder builder, string dsn,
3939
/// </summary>
4040
/// <param name="builder">The builder.</param>
4141
/// <param name="configureOptions">An action to configure the options.</param>
42+
/// <param name="configureAppBuilder">Optional parameter that allows you to configure and add additional sentry services like MAUI element event binders</param>
4243
/// <returns>The <paramref name="builder"/>.</returns>
4344
public static MauiAppBuilder UseSentry(
4445
this MauiAppBuilder builder,
@@ -71,8 +72,8 @@ public static MauiAppBuilder UseSentry(
7172

7273
if (configureAppBuilder != null)
7374
{
74-
var builder = new SentryMauiAppBuilder(services);
75-
configureAppBuilder.Invoke(builder);
75+
var appBuilder = new SentryMauiAppBuilder(services);
76+
configureAppBuilder.Invoke(appBuilder);
7677
}
7778

7879
builder.RegisterMauiEventsBinder();

0 commit comments

Comments
 (0)