Esempio n. 1
0
        private void SendNotificationMessage(MangaChapterNotification newChapterNotification)
        {
            var notification = new Notification {
                Title = newChapterNotification.MangaChapterInfo.Manga.Name,
                Body  = newChapterNotification.MangaChapterInfo.Name,
                Icon  = newChapterNotification.MangaChapterInfo.Manga.ImageUrl
            };

            _messageClient.SendMessage("notifications", notification);
        }
Esempio n. 2
0
        private void CreateNewMangaNotifications(List <MangaChapterInfo> newChapters)
        {
            var newNotifications = new List <MangaChapterNotification>();

            newChapters.ForEach(chapter => {
                var newNotification = new MangaChapterNotification()
                {
                    MangaChapterInfo = chapter
                };
                newNotifications.Add(newNotification);
                _mangaNotificationRep.Create(newNotification);
            });
            _mangaNotificationRep.Save();
            SendNotificationMessage(newNotifications.Last());
        }