From c3b33a2676681a22baeb03fd9a27592f576ebee9 Mon Sep 17 00:00:00 2001 From: Mikael Mengistu Date: Tue, 28 Feb 2017 16:52:42 -0800 Subject: [PATCH] Add Url + ILoggerFactory ctor for HubConnection (#253) --- src/Microsoft.AspNetCore.SignalR.Client/HubConnection.cs | 8 ++++---- .../HubConnectionTests.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.AspNetCore.SignalR.Client/HubConnection.cs b/src/Microsoft.AspNetCore.SignalR.Client/HubConnection.cs index 4175867344..4f35b8a6c2 100644 --- a/src/Microsoft.AspNetCore.SignalR.Client/HubConnection.cs +++ b/src/Microsoft.AspNetCore.SignalR.Client/HubConnection.cs @@ -46,14 +46,14 @@ namespace Microsoft.AspNetCore.SignalR.Client remove { _connection.Closed -= value; } } - public HubConnection(Uri url, IInvocationAdapter adapter) - : this(new Connection(url), adapter, null) - { } - public HubConnection(Uri url) : this(new Connection(url), new JsonNetInvocationAdapter(), null) { } + public HubConnection(Uri url, ILoggerFactory loggerFactory) + : this(new Connection(url), new JsonNetInvocationAdapter(), loggerFactory) + { } + public HubConnection(Uri url, IInvocationAdapter adapter, ILoggerFactory loggerFactory) : this(new Connection(url, loggerFactory), adapter, loggerFactory) { } diff --git a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs index 3473eda2d5..047c228f70 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests using (var httpClient = _testServer.CreateClient()) { var transport = new LongPollingTransport(httpClient, loggerFactory); - var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter()); + var connection = new HubConnection(new Uri("http://test/hubs")); try { await connection.StartAsync(transport, httpClient); @@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests using (var httpClient = _testServer.CreateClient()) { var transport = new LongPollingTransport(httpClient, loggerFactory); - var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter()); + var connection = new HubConnection(new Uri("http://test/hubs")); try { await connection.StartAsync(transport, httpClient); @@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests using (var httpClient = _testServer.CreateClient()) { var transport = new LongPollingTransport(httpClient, loggerFactory); - var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter()); + var connection = new HubConnection(new Uri("http://test/hubs")); try { await connection.StartAsync(transport, httpClient); @@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests using (var httpClient = _testServer.CreateClient()) { var transport = new LongPollingTransport(httpClient, loggerFactory); - var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter()); + var connection = new HubConnection(new Uri("http://test/hubs")); try { await connection.StartAsync(transport, httpClient);