Hi
I am trying to implement a CQRS project template similar to this C# example
Their (C#) interface for command handler is:-
and I have this as follows in VB.Net :-
Which works fine for a hard-wired class that maps to the command handler type of process.
e.g.
However I want to hook up the command and command handler using "unity"....
I am trying to implement a CQRS project template similar to this C# example
Their (C#) interface for command handler is:-
Code:
public interface ICommandHandler where T : ICommand
{
void Handle(T command);
}Code:
''' <summary>
''' Interface for a class that handles a given command
''' </summary>
''' <typeparam name="TCommand">
''' The command definition (including any parameters) to execute
''' </typeparam>
''' <remarks>
''' The linkage between command and command handler is performed by Unity as the IoC container
''' </remarks>
Public Interface ICommandHandler(Of In TCommand As ICommandDefinition)
''' <summary>
''' Perform the actions underlying performing this command
''' </summary>
''' <param name="command">
''' The comand (with any parameters) to execute
''' </param>
''' <remarks>
''' Each command will have a single implementing class command handler
''' </remarks>
Sub Handle(ByVal command As TCommand)
End Interfacee.g.
Code:
Public Class PingCommandHandler
Implements ICommandHandler(Of Definitions.PingCommandDefinition)
Public Sub Handle(command As Definitions.PingCommandDefinition) Implements ICommandHandler(Of Definitions.PingCommandDefinition).Handle
End Sub
End Class