public async Task AddMessageAsync(string body, string userName, DateTime when) { if (IsCommandMessage(body)) { var stockName = body.Split("=")[1]; _rabbitMqService.PushMessageToWorker(stockName); return; } var command = new AddMessageCommand { Body = body, UserName = userName, When = when }; await _mediator.Send(command); }