1
0
mirror of synced 2024-11-22 01:13:49 +00:00

[ci skip] Fixed: Binding.ForMethod failed because ControllerMethodBinding did not implement IControllerMethodBinding

This commit is contained in:
Mark van Renswoude 2019-08-15 12:10:29 +02:00
parent 8ec85ac99f
commit 0aa44cfefd
2 changed files with 13 additions and 4 deletions

View File

@ -14,7 +14,7 @@ namespace Tapeti.Default
/// instead use the ITapetiConfigBuilder RegisterController / RegisterAllControllers extension /// instead use the ITapetiConfigBuilder RegisterController / RegisterAllControllers extension
/// methods. /// methods.
/// </summary> /// </summary>
internal class ControllerMethodBinding : IBinding internal class ControllerMethodBinding : IControllerMethodBinding
{ {
/// <summary> /// <summary>
/// Contains all the required information to bind a controller method to a queue. /// Contains all the required information to bind a controller method to a queue.
@ -83,6 +83,12 @@ namespace Tapeti.Default
/// <inheritdoc /> /// <inheritdoc />
public string QueueName { get; private set; } public string QueueName { get; private set; }
/// <inheritdoc />
public Type Controller => bindingInfo.ControllerType;
/// <inheritdoc />
public MethodInfo Method => bindingInfo.Method;
/// <inheritdoc /> /// <inheritdoc />
public ControllerMethodBinding(IDependencyResolver dependencyResolver, BindingInfo bindingInfo) public ControllerMethodBinding(IDependencyResolver dependencyResolver, BindingInfo bindingInfo)

View File

@ -37,9 +37,10 @@ namespace Test
{ {
var flowStore = container.GetInstance<IFlowStore>(); var flowStore = container.GetInstance<IFlowStore>();
var flowStore2 = container.GetInstance<IFlowStore>(); var flowStore2 = container.GetInstance<IFlowStore>();
Console.WriteLine("IFlowHandler is singleton = " + (flowStore == flowStore2)); Console.WriteLine("IFlowHandler is singleton = " + (flowStore == flowStore2));
flowStore.Load().Wait();
connection.Connected += (sender, e) => { Console.WriteLine("Event Connected"); }; connection.Connected += (sender, e) => { Console.WriteLine("Event Connected"); };
connection.Disconnected += (sender, e) => { Console.WriteLine("Event Disconnected"); }; connection.Disconnected += (sender, e) => { Console.WriteLine("Event Disconnected"); };
connection.Reconnected += (sender, e) => { Console.WriteLine("Event Reconnected"); }; connection.Reconnected += (sender, e) => { Console.WriteLine("Event Reconnected"); };
@ -52,6 +53,7 @@ namespace Test
Console.WriteLine("Done!"); Console.WriteLine("Done!");
/*
var response = container.GetInstance<ITransientPublisher>() var response = container.GetInstance<ITransientPublisher>()
.RequestResponse<PoloConfirmationRequestMessage, PoloConfirmationResponseMessage>( .RequestResponse<PoloConfirmationRequestMessage, PoloConfirmationResponseMessage>(
new PoloConfirmationRequestMessage new PoloConfirmationRequestMessage
@ -60,11 +62,12 @@ namespace Test
}).Result; }).Result;
Console.WriteLine(response.ShouldMatchState); Console.WriteLine(response.ShouldMatchState);
*/
//connection.GetPublisher().Publish(new FlowEndController.PingMessage()); //connection.GetPublisher().Publish(new FlowEndController.PingMessage());
//container.GetInstance<IFlowStarter>().Start<MarcoController, bool>(c => c.StartFlow, true).Wait(); container.GetInstance<IFlowStarter>().Start<MarcoController, bool>(c => c.StartFlow, true).Wait();
//container.GetInstance<IFlowStarter>().Start<MarcoController>(c => c.TestParallelRequest).Wait(); container.GetInstance<IFlowStarter>().Start<MarcoController>(c => c.TestParallelRequest).Wait();
Thread.Sleep(1000); Thread.Sleep(1000);