示例#1
0
        public Task Send(UserReq req)
        {
            _logger.Info($"user name: {req.Name}");
            var addCommand = _bus.SendAsync(new AddUserCommand {
                UserName = req.Name
            });
            var addEvent = _bus.PublishAsync(new UserAdded {
                UserName = req.Name
            });

            Task.WaitAll(addCommand, addEvent);
            return(Task.CompletedTask);
        }