From ab4ba0b57758b6b9836bc2521081a62a5dd36154 Mon Sep 17 00:00:00 2001 From: Lucidiot Date: Tue, 3 Sep 2019 08:27:37 +0200 Subject: [PATCH] Avoid deprecated AddHandler signature --- HabitSharp/HabiticaApi.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/HabitSharp/HabiticaApi.cs b/HabitSharp/HabiticaApi.cs index d1ca64f..afd1cee 100644 --- a/HabitSharp/HabiticaApi.cs +++ b/HabitSharp/HabiticaApi.cs @@ -24,11 +24,14 @@ namespace HabitSharp this.Client.Authenticator = new HabiticaAuthenticator(UserID, ApiKey); // Override JSON serialization - this.Client.AddHandler("application/json", NewtonsoftJsonSerializer.Default); - this.Client.AddHandler("text/json", NewtonsoftJsonSerializer.Default); - this.Client.AddHandler("text/x-json", NewtonsoftJsonSerializer.Default); - this.Client.AddHandler("text/javascript", NewtonsoftJsonSerializer.Default); - this.Client.AddHandler("*+json", NewtonsoftJsonSerializer.Default); + this.Client.AddHandler( + () => NewtonsoftJsonSerializer.Default, + "application/json", + "text/json", + "text/x-json", + "text/javascript", + "*+json" + ); this.Tags = new TagManager(this); this.Notifications = new NotificationManager(this);