Skip to content

Commit 1b99609

Browse files
committed
Use Same Rest Client
1 parent 9a081f5 commit 1b99609

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Source/vj0.Shared/SharedGlobal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static class SharedGlobal
6262
false;
6363
#endif
6464

65-
private static RestClient RestClient { get; } = new(
65+
public static RestClient RestClient { get; } = new(
6666
new RestClientOptions
6767
{
6868
UserAgent = $"{APP_NAME}/{VERSION}"

Source/vj0/Services/RestAPIService.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
using System.Threading.Tasks;
66

77
using RestSharp;
8-
using RestSharp.Serializers.NewtonsoftJson;
98

109
using vj0.Framework;
1110
using vj0.Models.API;
11+
using vj0.Shared;
1212
using vj0.Shared.Models.API;
1313

1414
namespace vj0.Services;
@@ -18,15 +18,10 @@ public class RestAPIService : IService
1818
public readonly CentralAPI Central;
1919
public readonly EpicGamesAPI EpicGames;
2020
public readonly GitHubAPI GitHub;
21-
private readonly RestClient _client;
21+
private RestClient _client => SharedGlobal.RestClient;
2222

2323
public RestAPIService()
2424
{
25-
_client = new RestClient(new RestClientOptions
26-
{
27-
UserAgent = $"{APP_NAME}/{VERSION}"
28-
}, configureSerialization: s => s.UseSerializer<JsonNetSerializer>());
29-
3025
Central = new CentralAPI(_client);
3126
EpicGames = new EpicGamesAPI(_client);
3227
GitHub = new GitHubAPI(_client);

0 commit comments

Comments
 (0)