//Save in User Notification After check if Notification already Saved before in previouse method public int SaveInNotificationUser(NotificationUserModel model) { var data = Mapper.Map <NotificationUserModel, NotificationUser>(model); _NotificationUserRepository.Save(data); _unitOfWork.Submit(); return((int)data.ID); }
/// <summary> /// Saves the notification Then sets the notification to a specific user /// </summary> /// <param name="model"></param> /// <param name="userID">The user to receive the notification</param> /// <returns></returns> public int Save(NotificationModel model, int userID) { int notificationID = this.Save(model); if (notificationID > 0) { NotificationUserModel notificationUserModel = new NotificationUserModel() { NotificationID = notificationID, AppUserID = userID, IsSeen = false, }; var notificationUser = Mapper.Map <NotificationUserModel, NotificationUser>(notificationUserModel); _NotificationUserRepository.Save(notificationUser); _unitOfWork.Submit(); } return(notificationID); }