From 0aa44cfefdf119a6ca70b6474b52987e7aeb9e9d Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Thu, 15 Aug 2019 12:10:29 +0200 Subject: [PATCH] [ci skip] Fixed: Binding.ForMethod failed because ControllerMethodBinding did not implement IControllerMethodBinding --- Tapeti/Default/ControllerMethodBinding.cs | 8 +++++++- Test/Program.cs | 9 ++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Tapeti/Default/ControllerMethodBinding.cs b/Tapeti/Default/ControllerMethodBinding.cs index 22c019d..3722877 100644 --- a/Tapeti/Default/ControllerMethodBinding.cs +++ b/Tapeti/Default/ControllerMethodBinding.cs @@ -14,7 +14,7 @@ namespace Tapeti.Default /// instead use the ITapetiConfigBuilder RegisterController / RegisterAllControllers extension /// methods. /// - internal class ControllerMethodBinding : IBinding + internal class ControllerMethodBinding : IControllerMethodBinding { /// /// Contains all the required information to bind a controller method to a queue. @@ -83,6 +83,12 @@ namespace Tapeti.Default /// public string QueueName { get; private set; } + /// + public Type Controller => bindingInfo.ControllerType; + + /// + public MethodInfo Method => bindingInfo.Method; + /// public ControllerMethodBinding(IDependencyResolver dependencyResolver, BindingInfo bindingInfo) diff --git a/Test/Program.cs b/Test/Program.cs index ccca437..771a4a0 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -37,9 +37,10 @@ namespace Test { var flowStore = container.GetInstance(); var flowStore2 = container.GetInstance(); - Console.WriteLine("IFlowHandler is singleton = " + (flowStore == flowStore2)); + flowStore.Load().Wait(); + connection.Connected += (sender, e) => { Console.WriteLine("Event Connected"); }; connection.Disconnected += (sender, e) => { Console.WriteLine("Event Disconnected"); }; connection.Reconnected += (sender, e) => { Console.WriteLine("Event Reconnected"); }; @@ -52,6 +53,7 @@ namespace Test Console.WriteLine("Done!"); + /* var response = container.GetInstance() .RequestResponse( new PoloConfirmationRequestMessage @@ -60,11 +62,12 @@ namespace Test }).Result; Console.WriteLine(response.ShouldMatchState); + */ //connection.GetPublisher().Publish(new FlowEndController.PingMessage()); - //container.GetInstance().Start(c => c.StartFlow, true).Wait(); - //container.GetInstance().Start(c => c.TestParallelRequest).Wait(); + container.GetInstance().Start(c => c.StartFlow, true).Wait(); + container.GetInstance().Start(c => c.TestParallelRequest).Wait(); Thread.Sleep(1000);