Working on a command dispatcher
This commit is contained in:
parent
31666b4ba0
commit
a86a2d7ade
5 changed files with 55 additions and 4 deletions
13
PlanTempus.Components/CommandHandler.cs
Normal file
13
PlanTempus.Components/CommandHandler.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Autofac;
|
||||
using PlanTempus.Components.Users.Create;
|
||||
|
||||
namespace PlanTempus.Components;
|
||||
|
||||
public class CommandHandler(IComponentContext context) : ICommandHandler
|
||||
{
|
||||
public Task<TCommandResult> Handle<TCommand, TCommandResult>(TCommand command)
|
||||
{
|
||||
var handler = context.Resolve<ICommandHandler<TCommand, TCommandResult>>();
|
||||
return handler.Handle(command);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue