Ejemplo n.º 1
0
        public async Task<IHttpActionResult> PostSystemNotificationAsync([NakedBody]string message) {
            if (String.IsNullOrWhiteSpace(message))
                return NotFound();

            var notification = new SystemNotification { Date = DateTimeOffset.UtcNow, Message = message };
            await _cacheClient.SetAsync("system-notification", notification);
            await _messagePublisher.PublishAsync(notification);

            return Ok(notification);
        }
Ejemplo n.º 2
0
 private Task OnSystemNotificationAsync(SystemNotification notification, CancellationToken cancellationToken = default(CancellationToken)) {
     return Context.Connection.TypedBroadcast(notification);
 }
Ejemplo n.º 3
0
        public IHttpActionResult PostSystemNotification([NakedBody]string message) {
            if (String.IsNullOrEmpty(message))
                return NotFound();

            var notification = new SystemNotification { Date = DateTimeOffset.UtcNow, Message = message };
            _cacheClient.Set("system-notification", notification);
            _messagePublisher.Publish(notification);

            return Ok(notification);
        }