From 59e368369b20039303a9e67ed9f9c7456284cf4e Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sun, 29 Oct 2017 13:48:50 +0800 Subject: [PATCH] refactoring --- src/DotNetCore.CAP/Dashboard/JsonStats.cs | 2 +- src/DotNetCore.CAP/{ => Internal}/CapCache.cs | 6 +++--- src/DotNetCore.CAP/Internal/ConsumerContext.cs | 4 ++-- .../NodeDiscovery/INodeDiscoveryProvider.Consul.cs | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) rename src/DotNetCore.CAP/{ => Internal}/CapCache.cs (98%) diff --git a/src/DotNetCore.CAP/Dashboard/JsonStats.cs b/src/DotNetCore.CAP/Dashboard/JsonStats.cs index 78ad871..fbc9f2c 100644 --- a/src/DotNetCore.CAP/Dashboard/JsonStats.cs +++ b/src/DotNetCore.CAP/Dashboard/JsonStats.cs @@ -37,7 +37,7 @@ namespace DotNetCore.CAP.Dashboard private class StubPage : RazorPage { - public override void Execute() + protected override void Execute() { } } diff --git a/src/DotNetCore.CAP/CapCache.cs b/src/DotNetCore.CAP/Internal/CapCache.cs similarity index 98% rename from src/DotNetCore.CAP/CapCache.cs rename to src/DotNetCore.CAP/Internal/CapCache.cs index 8bb55f6..d9826db 100644 --- a/src/DotNetCore.CAP/CapCache.cs +++ b/src/DotNetCore.CAP/Internal/CapCache.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -namespace DotNetCore.CAP +namespace DotNetCore.CAP.Internal { #region Cache class @@ -15,7 +15,7 @@ namespace DotNetCore.CAP /// // ReSharper disable once InheritdocConsiderUsage // ReSharper disable once InconsistentNaming - public class Cache : IDisposable + internal class Cache : IDisposable { #region Constructor and class members @@ -328,7 +328,7 @@ namespace DotNetCore.CAP /// instance. /// The .Global member is lazy instanciated. /// - public class CapCache : Cache + internal class CapCache : Cache { #region Static Global Cache instance diff --git a/src/DotNetCore.CAP/Internal/ConsumerContext.cs b/src/DotNetCore.CAP/Internal/ConsumerContext.cs index 288b629..cafd33f 100644 --- a/src/DotNetCore.CAP/Internal/ConsumerContext.cs +++ b/src/DotNetCore.CAP/Internal/ConsumerContext.cs @@ -21,11 +21,11 @@ namespace DotNetCore.CAP.Internal /// /// a descriptor of consumer information need to be performed. /// - public ConsumerExecutorDescriptor ConsumerDescriptor { get; set; } + public ConsumerExecutorDescriptor ConsumerDescriptor { get; } /// /// consumer received message. /// - public MessageContext DeliverMessage { get; set; } + public MessageContext DeliverMessage { get; } } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs b/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs index 6234c9c..6f5cc59 100644 --- a/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs +++ b/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Consul; +using DotNetCore.CAP.Internal; using Microsoft.Extensions.Logging; namespace DotNetCore.CAP.NodeDiscovery @@ -90,7 +91,7 @@ namespace DotNetCore.CAP.NodeDiscovery } } - public void InitClient() + private void InitClient() { _consul = new ConsulClient(config => {