Beispiel #1
0
        private async Task <IActionResult> QueueCommandAsync(ICommand command)
        {
            var message = JsonConvert.SerializeObject(
                command,
                new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.All
            });

            var result = await _commandQueueService.TryAddMessageAsync(message);

            if (!result.IsSuccess)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, result.ErrorMessage));
            }

            return(Ok());
        }