private NotificationData BuildNotificationData(Notification notification, NotificationDataStorage notificationsData) { var data = new NotificationData(); if (notification is AbstractCommentNotification commentNotification) { data.Comment = BuildNotificationCommentInfo(notificationsData.CommentsByIds.GetOrDefault(commentNotification.CommentId)); } return(data); }
private NotificationInfo BuildNotificationInfo(Notification notification, NotificationDataStorage notificationsData) { return(new NotificationInfo { Id = notification.Id, Author = BuildShortUserInfo(notification.InitiatedBy), Type = notification.GetNotificationType().ToString(), CreateTime = notification.CreateTime, CourseId = notification.CourseId, Data = BuildNotificationData(notification, notificationsData), }); }