Exemple #1
0
        public async Task <Result <BikeResponse> > Handle(AddBikeCommand request, CancellationToken cancellationToken)
        {
            var result = await _bikeService.AddBikeAsync(request);

            result.IfSucc(s =>
            {
                var message = new BikeEventMessage()
                {
                    MessageType = s.GetType().Name,
                    Method      = ApiMethod.POST.ToString(),
                    Message     = s
                };

                _client.PublishEvent(message);
            });

            return(result);
        }