Line data Source code
1 : using System;
2 : using Akka.Actor;
3 : using Cqrs.Akka.Domain;
4 : using Cqrs.Akka.Tests.Unit.Aggregates;
5 : using Cqrs.Commands;
6 :
7 : namespace Cqrs.Akka.Tests.Unit.Commands.Handlers
8 : {
9 : public class EndConversationCommandHandler
10 : : ICommandHandler<Guid, EndConversationCommand>
11 0 : {
12 : /// <summary>
13 : /// Instantiates the <see cref="EndConversationCommandHandler"/> class registering any <see cref="ReceiveActor.Receive{T}(System.Func{T,System.Threading.Tasks.Task})"/> required.
14 : /// </summary>
15 1 : public EndConversationCommandHandler(IAkkaAggregateResolver aggregateResolver)
16 : {
17 : AggregateResolver = aggregateResolver;
18 : }
19 :
20 : protected IAkkaAggregateResolver AggregateResolver { get; private set; }
21 :
22 : #region Implementation of IMessageHandler<in EndConversationCommand>
23 :
24 0 : public void Handle(EndConversationCommand command)
25 : {
26 : IActorRef item = AggregateResolver.ResolveActor<HelloWorld, Guid>(command.Id);
27 : bool result = item.Ask<bool>(command).Result;
28 : // item.Tell(parameters);
29 : }
30 :
31 : #endregion
32 : }
33 : }
|