Skip to content

Commit

Permalink
Updated obsolete message
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski authored Jan 8, 2021
1 parent 88b9aec commit cfc0dee
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app,
return app.UseMiddleware<ExceptionlessMiddleware>(client);
}

[Obsolete("ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
[Obsolete("UseExceptionless should be called without an overload, ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, Action<ExceptionlessConfiguration> configure) {
var client = app.ApplicationServices.GetService<ExceptionlessClient>() ?? ExceptionlessClient.Default;
configure?.Invoke(client.Configuration);
return app.UseExceptionless(client);
}

[Obsolete("ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
[Obsolete("UseExceptionless should be called without an overload, ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, IConfiguration configuration) {
var client = app.ApplicationServices.GetService<ExceptionlessClient>() ?? ExceptionlessClient.Default;
client.Configuration.ReadFromConfiguration(configuration);
return app.UseExceptionless(client);
}

[Obsolete("ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
[Obsolete("UseExceptionless should be called without an overload, ExceptionlessClient should be configured when adding to services collection using AddExceptionless")]
public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, string apiKey) {
var client = app.ApplicationServices.GetService<ExceptionlessClient>() ?? ExceptionlessClient.Default;
client.Configuration.ApiKey = apiKey;
Expand Down Expand Up @@ -103,4 +103,4 @@ public static EventBuilder SetHttpContext(this EventBuilder builder, HttpContext
return builder;
}
}
}
}

0 comments on commit cfc0dee

Please sign in to comment.