/// <summary> /// Converts a repo notification to a notificationDTO for frontend to use /// </summary> /// <param name="repoN"></param> /// <returns></returns> internal static NotificationDTO RepoNotifToNotifDTO(Repository.Models.Notification repoN) { NotificationDTO newNotif = new NotificationDTO(); newNotif.NotificationId = repoN.NotificationId; newNotif.OtherId = Guid.Parse(repoN.OtherId); newNotif.FromService = repoN.FromService; newNotif.CreatorId = repoN.CreatorId; return(newNotif); }
/// <summary> /// Converts a comment notification to a notification to be stored in the database /// service: c = comments, d = disuccsion, r = review /// </summary> /// <param name="userid"></param> /// <param name="commentId"></param> /// <param name="v"></param> /// <returns></returns> internal static Repository.Models.Notification ModelNotifToRepoNotif(string userid, string otherId, string service, string creatorid) { Repository.Models.Notification newNotification = new Repository.Models.Notification(); newNotification.NotificationId = Guid.NewGuid().ToString(); newNotification.UserId = userid; newNotification.OtherId = otherId.ToString(); newNotification.FromService = service; newNotification.CreatorId = creatorid; return(newNotification); }