public Task<TakeOwnershipResponse> Handle(TakeOwnershipRequest request)
        {
            return _controller.TakeOwnership(request.Subject).ContinueWith(t => new TakeOwnershipResponse
            {
                NodeId = _graph.NodeId,
                Status = t.Result,
                Subject = request.Subject
            }).ContinueWith(t => {
                _logger.InfoMessage(() => {
                    var @event = new TakeOwnershipRequestReceived(request.Subject, _envelope.ReplyUri);
                    if (t.Result != null) @event.Status = t.Result.Status;

                    return @event;
                });

                return t.Result;
            });
        }
Example #2
0
        public Task <TakeOwnershipResponse> Handle(TakeOwnershipRequest request)
        {
            return(_controller.TakeOwnership(request.Subject).ContinueWith(t => new TakeOwnershipResponse
            {
                NodeId = _graph.NodeId,
                Status = t.Result,
                Subject = request.Subject
            }).ContinueWith(t => {
                _logger.InfoMessage(() => {
                    var @event = new TakeOwnershipRequestReceived(request.Subject, _envelope.ReplyUri);
                    if (t.Result != null)
                    {
                        @event.Status = t.Result.Status;
                    }

                    return @event;
                });

                return t.Result;
            }));
        }