public static NotificationDTO Map(MessageNotificationBO messageNotification, IZeus zeus) { NotificationDTO self = new NotificationDTO(); self.FontAwesome = "fa fa-envelope-o"; return(self); }
//mark messages as seen & async public async Task SeenAsync(MessageNotificationBO messageNotification) { if (messageNotification != null) { messageNotification.NotificationState = Entity.Enums.NotificationState.Seen; await UpdateAsync(messageNotification); } }
public async Task UpdateAsync(MessageNotificationBO messageNotification) { if (messageNotification != null) { db.messageNotificationRepository.Edit(messageNotification); await unitofWork.CommitAsync(); } }
public async Task ReadAsync(MessageNotificationBO messageNotification) { if (messageNotification != null) { messageNotification.NotificationState = Entity.Enums.NotificationState.Read; messageNotification.ReadDate = DateTime.UtcNow; await UpdateAsync(messageNotification); } }
public void Read(MessageNotificationBO messageNotification) { if (messageNotification != null) { messageNotification.NotificationState = Entity.Enums.NotificationState.Read; messageNotification.ReadDate = DateTime.UtcNow; Update(messageNotification); } }
public virtual void Add(MessageNotificationBO messageNotification) { if (messageNotification == null) { throw new ArgumentNullException("messageNotification", "Message Notification is null"); } else { db.messageNotificationRepository.Add(messageNotification); unitofWork.Commit(); } }
public async Task AddAsync(MessageNotificationBO messageNotification) { if (messageNotification == null) { throw new ArgumentNullException("messageNotification", "Message Notification is null"); } else { db.messageNotificationRepository.Add(messageNotification); await unitofWork.CommitAsync(); } }
public virtual void Delete(MessageNotificationBO messageNotification, bool purge = false) { if (purge) { db.messageNotificationRepository.Delete(messageNotification); unitofWork.Commit(); } else { messageNotification.Audit.RecordState = Entity.Enums.RecordStateType.InActive; Update(messageNotification); } }