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); }
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()); }