public async Task CreateNotificationAsync(CreateNotificationDto dto) { var notification = new ARNotification() { AACreatedDate = Clock.Now, ARNotificationContent = dto.NotificationContent, ARNotificationObjectID = dto.NotificationObjectId, ARNotificationObjectType = dto.NotificationObjectType, ARNotificationRead = false, ARNotificationSystemTypeCombo = NotificationSystemType.Message.ToString(), ARNotificationType = dto.NotificationType, FK_ADUserID = dto.UserId }; await _unitOfWork.GetRepository <ARNotification>().InsertAsync(notification); await _unitOfWork.CompleteAsync(); }
public static NotificationDto ToNotificationDto(this ARNotification entity) { return(entity == null ? null : new NotificationDto() { NotificationSystemType = entity.ARNotificationSystemTypeCombo.ToDictionaryItemDto <NotificationSystemType>(), NotificationType = entity.ARNotificationType, NotificationContent = entity.ARNotificationContent, NotificationObjectType = entity.ARNotificationObjectType, ARNotificationRead = entity.ARNotificationRead, CreatedDate = entity.AACreatedDate.ToSecondsTimestamp(), Id = entity.Id, NotificationObjectID = entity.ARNotificationObjectID, NotificationPriority = entity.ARNotificationPriority }); }