From 7dbd2f803b055a77583eefe859e7ac7fd8de1867 Mon Sep 17 00:00:00 2001
From: ShiningRush <277040271@qq.com>
Date: Wed, 27 Dec 2017 17:12:58 +0800
Subject: [PATCH] add cmd to publish to nuget
---
src/Directory.Build.props | 5 +-
.../IocResolver.cs | 16 ++++-
.../ServiceAntModule.cs | 13 +++-
.../IocResolver.cs | 18 ++++++
.../ServiceAntInstaller.cs | 9 ++-
src/ServiceAnt/Handler/IHandlerFactory.cs | 15 +++++
src/ServiceAnt/InProcessServiceBus.cs | 16 ++---
.../Infrastructure/Dependency/IIocResolver.cs | 3 +
.../Request/Handler/ActionRequestHandler.cs | 47 ++++++++++++--
.../Request/Handler/IRequestHandler.cs | 26 +++++++-
src/ServiceAnt/Request/IAddRequestHandler.cs | 35 ++++++++++-
.../Subscription/IAddSubscription.cs | 43 +++++++++++--
.../Subscription/ISubscriptionManager.cs | 19 ++++++
.../InMemorySubscriptionsManager.cs | 61 +++++++++++++++++--
.../ServiceAnt.test/InProcessEventBus_Test.cs | 24 ++++----
tools/publishToNuget.bat | 11 ++--
16 files changed, 315 insertions(+), 46 deletions(-)
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 5e7da57..37a6b35 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -5,8 +5,11 @@
https://github.com/ShiningRush/ServiceAnt
https://github.com/ShiningRush/ServiceAnt/blob/master/LICENSE
+ https://github.com/ShiningRush/ServiceAnt
+ git
true
- 2.0.0-clinteastwood
+ true
+ 1.0.0
\ No newline at end of file
diff --git a/src/ServiceAnt.IocInstaller.Autofac/IocResolver.cs b/src/ServiceAnt.IocInstaller.Autofac/IocResolver.cs
index d259495..ba3fa19 100644
--- a/src/ServiceAnt.IocInstaller.Autofac/IocResolver.cs
+++ b/src/ServiceAnt.IocInstaller.Autofac/IocResolver.cs
@@ -8,6 +8,9 @@
namespace ServiceAnt.IocInstaller.Autofac
{
+ ///
+ /// IocResolver
+ ///
public class IocResolver : IIocResolver
{
private readonly IComponentContext _componentContext;
@@ -17,11 +20,22 @@ public IocResolver(IComponentContext componentContext)
_componentContext = componentContext;
}
+ ///
+ /// Releases a pre-resolved object. See Resolve methods.
+ ///
+ /// Object to be released
public void Release(object obj)
{
- //_componentContext
+ // AutoFac is no need to release object
}
+ ///
+ /// Gets an object from IOC container.
+ /// Returning object must be Released (see ) after usage.
+ ///
+ /// Type of the object to cast
+ /// Type of the object to resolve
+ /// The object instance
public T Resolve(Type type)
{
return (T)_componentContext.Resolve(type);
diff --git a/src/ServiceAnt.IocInstaller.Autofac/ServiceAntModule.cs b/src/ServiceAnt.IocInstaller.Autofac/ServiceAntModule.cs
index 257bc82..65d1f96 100644
--- a/src/ServiceAnt.IocInstaller.Autofac/ServiceAntModule.cs
+++ b/src/ServiceAnt.IocInstaller.Autofac/ServiceAntModule.cs
@@ -11,15 +11,26 @@
namespace ServiceAnt.IocInstaller.Autofac
{
+ ///
+ /// It used to install ServiceAnt to Ioc of Autofac
+ ///
public class ServiceAntModule : Module
{
private static System.Reflection.Assembly[] _handlerAssemblies;
+ ///
+ /// Constructor
+ ///
+ /// the assemblies which containg handler, thos will be register to container
public ServiceAntModule(params System.Reflection.Assembly[] handlerAssemblies)
{
_handlerAssemblies = handlerAssemblies;
}
+ ///
+ /// Excute this method ater you builded container
+ ///
+ ///
public static void RegisterHandlers(IComponentContext container)
{
foreach (var aHandlerAssembly in _handlerAssemblies)
@@ -63,7 +74,7 @@ private static void RegisterHandlerType(IComponentContext container, Type aHandl
if (typeof(IRequestHandler).IsAssignableFrom(aInterface))
container.Resolve().AddRequestHandler(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(container.Resolve(), aHandlerType, genericArgs[0]));
else
- container.Resolve().AddSubScription(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(container.Resolve(), aHandlerType, genericArgs[0]));
+ container.Resolve().AddSubscription(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(container.Resolve(), aHandlerType, genericArgs[0]));
}
}
}
diff --git a/src/ServiceAnt.IocInstaller.Castle/IocResolver.cs b/src/ServiceAnt.IocInstaller.Castle/IocResolver.cs
index ad4059b..7ab61ae 100644
--- a/src/ServiceAnt.IocInstaller.Castle/IocResolver.cs
+++ b/src/ServiceAnt.IocInstaller.Castle/IocResolver.cs
@@ -8,20 +8,38 @@
namespace ServiceAnt.IocInstaller.Castle
{
+ ///
+ /// IocResolver
+ ///
public class IocResolver : IIocResolver
{
private readonly IWindsorContainer _container;
+ ///
+ /// Constructor
+ ///
+ /// the container of castle
public IocResolver(IWindsorContainer container)
{
_container = container;
}
+ ///
+ /// Releases a pre-resolved object. See Resolve methods.
+ ///
+ /// Object to be released
public void Release(object obj)
{
_container.Release(obj);
}
+ ///
+ /// Gets an object from IOC container.
+ /// Returning object must be Released (see ) after usage.
+ ///
+ /// Type of the object to cast
+ /// Type of the object to resolve
+ /// The object instance
public T Resolve(Type type)
{
return (T)_container.Resolve(type);
diff --git a/src/ServiceAnt.IocInstaller.Castle/ServiceAntInstaller.cs b/src/ServiceAnt.IocInstaller.Castle/ServiceAntInstaller.cs
index b47bf7e..0b67229 100644
--- a/src/ServiceAnt.IocInstaller.Castle/ServiceAntInstaller.cs
+++ b/src/ServiceAnt.IocInstaller.Castle/ServiceAntInstaller.cs
@@ -14,12 +14,19 @@
namespace ServiceAnt.IocInstaller.Castle
{
+ ///
+ /// It used to install ServiceAnt to Ioc of Castle
+ ///
public class ServiceAntInstaller : IWindsorInstaller
{
private readonly Assembly[] _handlerAssemblies;
private IWindsorContainer _container;
private IServiceBus _serviceBus;
+ ///
+ /// Constructor
+ ///
+ /// the assemblies which containg handler, thos will be register to container
public ServiceAntInstaller(params Assembly[] handlerAssemblies)
{
_handlerAssemblies = handlerAssemblies;
@@ -71,7 +78,7 @@ private void Kernel_ComponentRegistered(string key, IHandler handler)
if (typeof(IRequestHandler).GetTypeInfo().IsAssignableFrom(aInterface))
_serviceBus.AddRequestHandler(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(resolver, handler.ComponentModel.Implementation, genericArgs[0]));
else
- _serviceBus.AddSubScription(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(resolver, handler.ComponentModel.Implementation, genericArgs[0]));
+ _serviceBus.AddSubscription(genericArgs[0], new ServiceAnt.Handler.IocHandlerFactory(resolver, handler.ComponentModel.Implementation, genericArgs[0]));
}
}
}
diff --git a/src/ServiceAnt/Handler/IHandlerFactory.cs b/src/ServiceAnt/Handler/IHandlerFactory.cs
index 9b87787..e795b98 100644
--- a/src/ServiceAnt/Handler/IHandlerFactory.cs
+++ b/src/ServiceAnt/Handler/IHandlerFactory.cs
@@ -6,12 +6,27 @@
namespace ServiceAnt.Handler
{
+ ///
+ /// The interface is used to get handler
+ ///
public interface IHandlerFactory
{
+ ///
+ /// Get Handler
+ ///
+ ///
IHandler GetHandler();
+ ///
+ /// Get event type of registering event type
+ ///
+ ///
Type GetLocalEventType();
+ ///
+ /// Releast generated handler if need
+ ///
+ ///
void ReleaseHandler(object obj);
}
}
diff --git a/src/ServiceAnt/InProcessServiceBus.cs b/src/ServiceAnt/InProcessServiceBus.cs
index 05b258d..998ef5d 100644
--- a/src/ServiceAnt/InProcessServiceBus.cs
+++ b/src/ServiceAnt/InProcessServiceBus.cs
@@ -35,25 +35,25 @@ public InProcessServiceBus(ISubscriptionManager subcriptionManager, IRequestHand
#region Pub/Sub
- public void AddDynamicSubScription(string eventName, Func action)
+ public void AddDynamicSubscription(string eventName, Func action)
{
- _subcriptionManager.AddDynamicSubScription(eventName, action);
+ _subcriptionManager.AddDynamicSubscription(eventName, action);
}
- public void AddSubScription(Type eventType, IHandlerFactory factory)
+ public void AddSubscription(Type eventType, IHandlerFactory factory)
{
- _subcriptionManager.AddSubScription(eventType, factory);
+ _subcriptionManager.AddSubscription(eventType, factory);
}
- public void AddSubScription(Func action) where TEvent : TransportTray
+ public void AddSubscription(Func action) where TEvent : TransportTray
{
- _subcriptionManager.AddSubScription(action);
+ _subcriptionManager.AddSubscription(action);
}
- public void AddSubScription(IHandlerFactory factory) where TEvent : TransportTray
+ public void AddSubscription(IHandlerFactory factory) where TEvent : TransportTray
{
- _subcriptionManager.AddSubScription(factory);
+ _subcriptionManager.AddSubscription(factory);
}
public void RemoveDynamicSubscription(string eventName, Func action)
diff --git a/src/ServiceAnt/Infrastructure/Dependency/IIocResolver.cs b/src/ServiceAnt/Infrastructure/Dependency/IIocResolver.cs
index 80fe0fb..1e99929 100644
--- a/src/ServiceAnt/Infrastructure/Dependency/IIocResolver.cs
+++ b/src/ServiceAnt/Infrastructure/Dependency/IIocResolver.cs
@@ -2,6 +2,9 @@
namespace ServiceAnt.Infrastructure.Dependency
{
+ ///
+ /// IocResolver
+ ///
public interface IIocResolver
{
///
diff --git a/src/ServiceAnt/Request/Handler/ActionRequestHandler.cs b/src/ServiceAnt/Request/Handler/ActionRequestHandler.cs
index a0cb495..3c13036 100644
--- a/src/ServiceAnt/Request/Handler/ActionRequestHandler.cs
+++ b/src/ServiceAnt/Request/Handler/ActionRequestHandler.cs
@@ -7,40 +7,77 @@
namespace ServiceAnt.Request.Handler
{
- public class ActionRequestHandler : IRequestHandler where TEvent : TransportTray
+ ///
+ /// The container of request handler registing with delegate
+ ///
+ ///
+ public class ActionRequestHandler : IRequestHandler where TRequest : TransportTray
{
- private Func _action;
+ private Func _action;
- public ActionRequestHandler(Func action)
+ ///
+ /// Constructor
+ ///
+ /// register delagate
+ public ActionRequestHandler(Func action)
{
_action = action;
}
- public Task HandleAsync(TEvent param, IRequestHandlerContext handlerContext)
+ ///
+ /// Handle request async
+ ///
+ /// request
+ /// handler context
+ ///
+ public Task HandleAsync(TRequest param, IRequestHandlerContext handlerContext)
{
return _action(param, handlerContext);
}
- public bool IsSame(Func compareAction)
+ ///
+ /// Compare the registered delegate is same with inpurt delegate
+ ///
+ /// inpurt delegate
+ ///
+ public bool IsSame(Func compareAction)
{
return compareAction == _action;
}
}
+ ///
+ /// The container of request handler registing with delegate having dynamic request parameter
+ ///
public class ActionRequestHandler : IDynamicRequestHandler
{
private Func _action;
+ ///
+ /// Constructor
+ ///
+ ///
public ActionRequestHandler(Func action)
{
_action = action;
}
+ ///
+ /// Handle request async
+ ///
+ /// dynamic request parameter
+ /// handler context
+ ///
public Task HandleAsync(dynamic param, IRequestHandlerContext handlerContext)
{
return _action(param, handlerContext);
}
+ ///
+ /// Compare the registered delegate is same with inpurt delegate
+ ///
+ /// inpurt delegate
+ ///
public bool IsSame(Func compareAction)
{
return compareAction == _action;
diff --git a/src/ServiceAnt/Request/Handler/IRequestHandler.cs b/src/ServiceAnt/Request/Handler/IRequestHandler.cs
index 2e0368d..2abaa01 100644
--- a/src/ServiceAnt/Request/Handler/IRequestHandler.cs
+++ b/src/ServiceAnt/Request/Handler/IRequestHandler.cs
@@ -7,17 +7,39 @@
namespace ServiceAnt.Request.Handler
{
+ ///
+ /// The inerface of handling request
+ ///
public interface IRequestHandler : IHandler
{
}
- public interface IRequestHandler : IRequestHandler where TEvent : TransportTray
+ ///
+ /// The interface of handling request
+ ///
+ /// request parameter
+ public interface IRequestHandler : IRequestHandler where TRequest : TransportTray
{
- Task HandleAsync(TEvent param, IRequestHandlerContext handlerContext);
+ ///
+ /// Handle request async
+ ///
+ /// request
+ /// handler context
+ ///
+ Task HandleAsync(TRequest param, IRequestHandlerContext handlerContext);
}
+ ///
+ /// The interface of handling request with dynamic parameter
+ ///
public interface IDynamicRequestHandler : IRequestHandler
{
+ ///
+ /// Handle request async
+ ///
+ /// dynamic request parameter
+ /// handler context
+ ///
Task HandleAsync(dynamic param, IRequestHandlerContext handlerContext);
}
}
diff --git a/src/ServiceAnt/Request/IAddRequestHandler.cs b/src/ServiceAnt/Request/IAddRequestHandler.cs
index f2272c9..f73186a 100644
--- a/src/ServiceAnt/Request/IAddRequestHandler.cs
+++ b/src/ServiceAnt/Request/IAddRequestHandler.cs
@@ -7,21 +7,54 @@
namespace ServiceAnt.Handler.Request
{
+ ///
+ /// It uead to register request handler
+ ///
public interface IAddRequestHandler
{
+ ///
+ /// Register handler with handler factory
+ ///
+ ///
+ ///
void AddRequestHandler(Type eventType, IHandlerFactory factory);
+ ///
+ /// Register handler with handler factory
+ ///
+ ///
+ ///
void AddRequestHandler(IHandlerFactory factory)
where TEvent : TransportTray;
+ ///
+ /// Register handler with delegate
+ ///
+ ///
+ ///
void AddRequestHandler(Func action)
where TEvent : TransportTray;
+ ///
+ /// Register dynamic handler with delegate
+ ///
+ ///
+ ///
void AddDynamicRequestHandler(string eventName, Func action);
-
+ ///
+ /// Remove handler by event type
+ ///
+ ///
+ ///
void RemoveRequestHandler(Func action)
where TEvent : TransportTray;
+
+ ///
+ /// Remove dynamic handler by eventName
+ ///
+ ///
+ ///
void RemoveDynamicRequestHandler(string eventName, Func action);
}
}
diff --git a/src/ServiceAnt/Subscription/IAddSubscription.cs b/src/ServiceAnt/Subscription/IAddSubscription.cs
index 065aa74..75500d0 100644
--- a/src/ServiceAnt/Subscription/IAddSubscription.cs
+++ b/src/ServiceAnt/Subscription/IAddSubscription.cs
@@ -4,21 +4,54 @@
namespace ServiceAnt.Subscription
{
+ ///
+ /// AddSubscription
+ ///
public interface IAddSubscription
{
- void AddSubScription(Type eventType, IHandlerFactory factory);
+ ///
+ /// Add Subscription for event by factory
+ ///
+ /// The type of event must inherit TransportTray
+ /// The factory of handler
+ void AddSubscription(Type eventType, IHandlerFactory factory);
- void AddSubScription(IHandlerFactory factory)
+ ///
+ /// Add Subscription for event by factory
+ ///
+ /// The event must inherit TransportTray
+ ///
+ void AddSubscription(IHandlerFactory factory)
where TEvent : TransportTray;
- void AddSubScription(Func action)
+ ///
+ /// Add Subscription for event by delegate
+ ///
+ /// The event must inherit TransportTray
+ /// Handler delegate
+ void AddSubscription(Func action)
where TEvent : TransportTray;
- void AddDynamicSubScription(string eventName, Func action);
-
+ ///
+ /// Add Subscription for event by delegate with dynamic parameter
+ ///
+ /// the name of event(the class name of event type)
+ /// Handler delegate
+ void AddDynamicSubscription(string eventName, Func action);
+ ///
+ /// Remove subscription from servicebus
+ ///
+ /// The event must inherit TransportTray
+ /// Handler delegate
void RemoveSubscription(Func action)
where TEvent : TransportTray;
+
+ ///
+ /// Remove subscription from servicebus
+ ///
+ /// the name of event(the class name of event type)
+ /// Handler delegate
void RemoveDynamicSubscription(string eventName, Func action);
}
}
diff --git a/src/ServiceAnt/Subscription/ISubscriptionManager.cs b/src/ServiceAnt/Subscription/ISubscriptionManager.cs
index 91b759c..0c3b6d1 100644
--- a/src/ServiceAnt/Subscription/ISubscriptionManager.cs
+++ b/src/ServiceAnt/Subscription/ISubscriptionManager.cs
@@ -7,11 +7,30 @@
namespace ServiceAnt.Subscription
{
+ ///
+ /// SubscriptionManager
+ ///
public interface ISubscriptionManager : IAddSubscription
{
+ ///
+ /// Get all factory of handler by evetname
+ ///
+ ///
+ ///
List GetHandlerFactoriesForEvent(string eventName);
+
+ ///
+ /// Get all factory of handler by event object
+ ///
+ ///
+ ///
List GetHandlerFactoriesForEvent(TransportTray @event);
+ ///
+ /// Get event name by event type
+ ///
+ ///
+ ///
string GetEventName(Type aType);
}
}
diff --git a/src/ServiceAnt/Subscription/InMemorySubscriptionsManager.cs b/src/ServiceAnt/Subscription/InMemorySubscriptionsManager.cs
index 74e5122..c3add3d 100644
--- a/src/ServiceAnt/Subscription/InMemorySubscriptionsManager.cs
+++ b/src/ServiceAnt/Subscription/InMemorySubscriptionsManager.cs
@@ -9,49 +9,90 @@
namespace ServiceAnt.Subscription
{
+ ///
+ /// InMemorySubscriptionsManager
+ ///
public class InMemorySubscriptionsManager : ISubscriptionManager
{
private readonly ConcurrentDictionary> _handlerFactories;
+ ///
+ /// Constructor
+ ///
public InMemorySubscriptionsManager()
{
_handlerFactories = new ConcurrentDictionary>();
}
- public void AddDynamicSubScription(string eventName, Func action)
+ ///
+ /// Add Subscription for event by delegate with dynamic parameter
+ ///
+ /// the name of event(the class name of event type)
+ /// Handler delegate
+ public void AddDynamicSubscription(string eventName, Func action)
{
var eventHandler = new ActionEventHandler(action);
DoAddSubscription(new SingletonHandlerFactory(eventHandler), eventName: eventName);
}
- public void AddSubScription(Type eventType, IHandlerFactory factory)
+ ///
+ /// Add Subscription for event by factory
+ ///
+ /// The type of event must inherit TransportTray
+ /// The factory of handler
+ public void AddSubscription(Type eventType, IHandlerFactory factory)
{
DoAddSubscription(factory, eventType);
}
- public void AddSubScription(Func action) where TEvent : TransportTray
+ ///
+ /// Add Subscription for event by delegate
+ ///
+ /// The event must inherit TransportTray
+ /// Handler delegate
+ public void AddSubscription(Func action) where TEvent : TransportTray
{
var eventHandler = new ActionEventHandler(action);
- AddSubScription(new SingletonHandlerFactory(eventHandler, typeof(TEvent)));
+ AddSubscription(new SingletonHandlerFactory(eventHandler, typeof(TEvent)));
}
- public void AddSubScription(IHandlerFactory factory) where TEvent : TransportTray
+ ///
+ /// Add Subscription for event by factory
+ ///
+ /// The event must inherit TransportTray
+ ///
+ public void AddSubscription(IHandlerFactory factory) where TEvent : TransportTray
{
DoAddSubscription(factory, typeof(TEvent));
}
+ ///
+ /// Get all factory of handler by evetname
+ ///
+ ///
+ ///
public List GetHandlerFactoriesForEvent(string eventName)
{
return GetOrCreateHandlerFactories(eventName);
}
+ ///
+ /// Get all factory of handler by event object
+ ///
+ ///
+ ///
public List GetHandlerFactoriesForEvent(TransportTray @event)
{
return GetOrCreateHandlerFactories(GetEventName(@event.GetType()));
}
+ ///
+ /// Remove subscription from servicebus
+ ///
+ /// the name of event(the class name of event type)
+ /// Handler delegate
public void RemoveDynamicSubscription(string eventName, Func action)
{
GetOrCreateHandlerFactories(eventName)
@@ -76,6 +117,11 @@ public void RemoveDynamicSubscription(string eventName, Func acti
});
}
+ ///
+ /// Remove subscription from servicebus
+ ///
+ /// The event must inherit TransportTray
+ /// Handler delegate
public void RemoveSubscription(Func action) where TEvent : TransportTray
{
GetOrCreateHandlerFactories(typeof(TEvent).Name)
@@ -124,6 +170,11 @@ private void DoRemoveSubscription(IHandlerFactory factory, Type eventType = null
}
+ ///
+ /// Get event name by event type
+ ///
+ ///
+ ///
public string GetEventName(Type aType)
{
if (aType.IsGenericType)
diff --git a/test/ServiceAnt.test/InProcessEventBus_Test.cs b/test/ServiceAnt.test/InProcessEventBus_Test.cs
index 778cbf1..df99a0d 100644
--- a/test/ServiceAnt.test/InProcessEventBus_Test.cs
+++ b/test/ServiceAnt.test/InProcessEventBus_Test.cs
@@ -40,7 +40,7 @@ public async Task DynamicSubscription_ShouldTrigger()
var eventBus = new InProcessServiceBus();
var result = "error";
- eventBus.AddDynamicSubScription(typeof(TestEventData).Name, eventData =>
+ eventBus.AddDynamicSubscription(typeof(TestEventData).Name, eventData =>
{
return Task.Run(() =>
{
@@ -67,7 +67,7 @@ public void DynamicSubscription_ShouldNotTrigger_AfterRemove()
result = eventData.Msg;
});
};
- eventBus.AddDynamicSubScription(typeof(TestEventData).Name, delateFunc);
+ eventBus.AddDynamicSubscription(typeof(TestEventData).Name, delateFunc);
var testEventData = new TestEventData() { Msg = "success" };
eventBus.PublishSync(testEventData);
@@ -86,7 +86,7 @@ public void Subscription_ShouldTrigger()
var eventBus = new InProcessServiceBus();
var result = "error";
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -114,7 +114,7 @@ public void Subscription_ShouldNotTrigger_AfterRemove()
result = eventData.Msg;
});
};
- eventBus.AddSubScription(delateFunc);
+ eventBus.AddSubscription(delateFunc);
var testEventData = new TestEventData() { Msg = "success" };
eventBus.PublishSync(testEventData);
@@ -133,7 +133,7 @@ public void MutipleSubscription_ShouldTrigger()
var eventBus = new InProcessServiceBus();
var result = "error";
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -141,7 +141,7 @@ public void MutipleSubscription_ShouldTrigger()
});
});
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -162,7 +162,7 @@ public void GenericSubscription_ShouldTrigger()
var eventBus = new InProcessServiceBus();
var result = "error";
- eventBus.AddSubScription>(eventData =>
+ eventBus.AddSubscription>(eventData =>
{
return Task.Run(() =>
{
@@ -183,7 +183,7 @@ public void SubscriptionEventDataWithParam_ShouldTrigger()
var eventBus = new InProcessServiceBus();
var result = "error";
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -227,7 +227,7 @@ public void ShouldSupport_MutipleSameHandler()
var result1 = "error";
var result2 = "error";
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -235,7 +235,7 @@ public void ShouldSupport_MutipleSameHandler()
});
});
- eventBus.AddSubScription(eventData =>
+ eventBus.AddSubscription(eventData =>
{
return Task.Run(() =>
{
@@ -258,7 +258,7 @@ public void MutipleGenericSubscription_ByDifferentNameSpace_ShouldTrigger()
var result = "error";
var result2 = "error";
- eventBus.AddSubScription>(eventData =>
+ eventBus.AddSubscription>(eventData =>
{
return Task.Run(() =>
{
@@ -266,7 +266,7 @@ public void MutipleGenericSubscription_ByDifferentNameSpace_ShouldTrigger()
});
});
- eventBus.AddSubScription>(eventData =>
+ eventBus.AddSubscription>(eventData =>
{
return Task.Run(() =>
{
diff --git a/tools/publishToNuget.bat b/tools/publishToNuget.bat
index 3aabca8..187076e 100644
--- a/tools/publishToNuget.bat
+++ b/tools/publishToNuget.bat
@@ -1,5 +1,5 @@
@echo off
-set nugetexe=.\nuget.exe
+set nugetexe=%~dp0nuget.exe
set projNumber=1
if not exist .\nupkg md .\nupkg
@@ -12,11 +12,14 @@ for /f %%i in (needPublishPro.config) DO (
)
set /p userInput=请输入需要发布的项目序号,按回车确定:
-%nugetexe% pack ..\src\!projPath_%userInput%! -Build -Properties Configuration=Release -OutputDirectory .\nupkg -IncludeReferencedProjects -Symbols
+dotnet msbuild ..\src\!projPath_%userInput%! /t:pack /p:Configuration=Release /p:SourceLinkCreate=true
+rem %nugetexe% pack ..\src\!projPath_%userInput%! -Build -Properties Configuration=Release -OutputDirectory .\nupkg -IncludeReferencedProjects -Symbols
move ..\src\!projPath_%userInput%!\..\bin\Release\*.nupkg .\nupkg\
-%nugetexe% push .\*.nupkg -s https://www.nuget.org/api/v2/package 4917e7f9-0370-40c2-8074-f4f23b85ef41
-del /q /f .\nupkg\*.nupkg
+
+rem %nugetexe% push .\*.nupkg -Source https://www.nuget.org/api/v2/package 4917e7f9-0370-40c2-8074-f4f23b85ef41
+rem del /q /f .\nupkg\*.nupkg
+%nugetexe% push .\nupkg\*.nupkg -Source http://192.168.19.88:1024/nuget clear
:end
echo 上传packge完成,输入任意键继续