public void Post(AddAdminNotification request)
        {
            // This endpoint really just exists as post of a real with sickbeard
            var task = AddNotification(request);

            Task.WaitAll(task);
        }
        private Task AddNotification(AddAdminNotification request)
        {
            var notification = new NotificationRequest
            {
                Date        = DateTime.UtcNow,
                Description = request.Description,
                Level       = request.Level,
                Name        = request.Name,
                Url         = request.Url,
                UserIds     = _userManager.Users.Where(i => i.Policy.IsAdministrator).Select(i => i.Id.ToString("N")).ToList()
            };

            return(_notificationManager.SendNotification(notification, CancellationToken.None));
        }
Exemple #3
0
        private async Task AddNotification(AddAdminNotification request)
        {
            var notification = new NotificationRequest
            {
                Date        = DateTime.UtcNow,
                Description = request.Description,
                Level       = request.Level,
                Name        = request.Name,
                Url         = request.Url,
                UserIds     = _userManager.Users.Where(i => i.Configuration.IsAdministrator).Select(i => i.Id.ToString("N")).ToList()
            };

            await _notificationManager.SendNotification(notification, CancellationToken.None).ConfigureAwait(false);
        }
 public Task Post(AddAdminNotification request)
 {
     // This endpoint really just exists as post of a real with sickbeard
     return(AddNotification(request));
 }