public async Task <bool> AddMessage()
        {
            var body = await _context.RequestBodyAsync();

            var compositeMessage = JsonConvert.DeserializeObject <CompositeMessage>(body);

            _swimProtocolProvider.OnMessageReceived(new ReceivedMessageEventArgs()
            {
                CompositeMessage = compositeMessage
            });

            return(await this.JsonResponseAsync(new { status = "SUCCESS" }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> AddMessage([FromBody] CompositeMessage compositeMessage)
        {
            if (compositeMessage != null)
            {
                _swimProtocolProvider.OnMessageReceived(new ReceivedMessageEventArgs()
                {
                    CompositeMessage = compositeMessage
                });
            }
            else
            {
                _logger.LogWarning("Received NULL compositeMessage... skipping");
            }

            return(await Task.FromResult(Accepted()));
        }