From 92ba17d0629d963277dc23f0c3fe34e58b7d122d Mon Sep 17 00:00:00 2001 From: Hagen Siegel Date: Tue, 20 Jul 2021 07:07:55 +0200 Subject: [PATCH] Removed unused private Interface property. --- CoreRemoting.Tests/CoreRemoting.Tests.csproj | 6 +++--- CoreRemoting.Tests/RemotingConfigurationTests.cs | 4 ---- CoreRemoting.Tests/RpcTests.cs | 10 +++++----- CoreRemoting.Tests/SessionTests.cs | 2 +- CoreRemoting/ServiceProxy.cs | 11 ----------- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/CoreRemoting.Tests/CoreRemoting.Tests.csproj b/CoreRemoting.Tests/CoreRemoting.Tests.csproj index bcbd727..4fc82ec 100644 --- a/CoreRemoting.Tests/CoreRemoting.Tests.csproj +++ b/CoreRemoting.Tests/CoreRemoting.Tests.csproj @@ -7,14 +7,14 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CoreRemoting.Tests/RemotingConfigurationTests.cs b/CoreRemoting.Tests/RemotingConfigurationTests.cs index 823b20d..3c31294 100644 --- a/CoreRemoting.Tests/RemotingConfigurationTests.cs +++ b/CoreRemoting.Tests/RemotingConfigurationTests.cs @@ -1,15 +1,11 @@ using System; using System.IO; -using System.Net; using System.Reflection; -using System.Threading; -using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using CoreRemoting.Authentication; using CoreRemoting.Channels.Websocket; using CoreRemoting.ClassicRemotingApi; using CoreRemoting.DependencyInjection; using CoreRemoting.Serialization.Binary; -using CoreRemoting.Serialization.Bson; using CoreRemoting.Tests.Tools; using Xunit; diff --git a/CoreRemoting.Tests/RpcTests.cs b/CoreRemoting.Tests/RpcTests.cs index 7a03426..f7c8d02 100644 --- a/CoreRemoting.Tests/RpcTests.cs +++ b/CoreRemoting.Tests/RpcTests.cs @@ -45,7 +45,7 @@ public void Call_on_Proxy_should_be_invoked_on_remote_service() int serverErrorCount = 0; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); void ClientAction() @@ -109,7 +109,7 @@ public void Call_on_Proxy_should_be_invoked_on_remote_service_without_MessageEnc int serverErrorCount = 0; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); void ClientAction() @@ -165,7 +165,7 @@ public void Delegate_invoked_on_server_should_callback_client() int serverErrorCount = 0; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); void ClientAction() @@ -218,7 +218,7 @@ public void Events_should_work_remotly() bool serviceEventCalled = false; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); using var client = new RemotingClient( @@ -270,7 +270,7 @@ public void External_types_should_work_as_remote_service_parameters() int serverErrorCount = 0; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); void ClientAction() diff --git a/CoreRemoting.Tests/SessionTests.cs b/CoreRemoting.Tests/SessionTests.cs index 6d60473..aa6c2b9 100644 --- a/CoreRemoting.Tests/SessionTests.cs +++ b/CoreRemoting.Tests/SessionTests.cs @@ -110,7 +110,7 @@ public void Client_Connect_should_throw_exception_on_invalid_auth_credentials() int serverErrorCount = 0; using var server = new RemotingServer(serverConfig); - server.Error += (sender, e) => serverErrorCount++; + server.Error += (_, _) => serverErrorCount++; server.Start(); var clientAction = new Action((password, shouldThrow) => diff --git a/CoreRemoting/ServiceProxy.cs b/CoreRemoting/ServiceProxy.cs index 1a30d55..4f76818 100644 --- a/CoreRemoting/ServiceProxy.cs +++ b/CoreRemoting/ServiceProxy.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using Castle.DynamicProxy; @@ -32,9 +31,6 @@ public ServiceProxy(RemotingClient client, string serviceName = "") string.IsNullOrWhiteSpace(serviceName) ? serviceInterfaceType.FullName : serviceName; - - Interface = - (TServiceInterface)_client.ProxyGenerator.CreateInterfaceProxyWithoutTarget(typeof (TServiceInterface), this); } /// @@ -59,13 +55,6 @@ void IServiceProxy.Shutdown() GC.SuppressFinalize(this); } - /// - /// Gets or sets the interface type of the proxied remote service. - /// - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local")] - [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local")] - private TServiceInterface Interface { get; set; } - /// /// Intercepts a call of a member on the proxy object. ///