public virtual void InsertSubscription(NotificationSubscriptionInfo subscription)
 {
     using (_unitOfWorkManager.Current.SetTenantId(subscription.TenantId))
     {
         _notificationSubscriptionRepository.Insert(subscription);
         _unitOfWorkManager.Current.SaveChanges();
     }
 }
        public virtual async Task InsertSubscriptionAsync(NotificationSubscriptionInfo subscription)
        {
            using (_unitOfWorkManager.Current.SetTenantId(subscription.TenantId))
            {
                await _notificationSubscriptionRepository.InsertAsync(subscription);

                await _unitOfWorkManager.Current.SaveChangesAsync();
            }
        }
        /// <summary>
        /// Converts <see cref="UserNotificationInfo"/> to <see cref="UserNotification"/>.
        /// </summary>
        public static NotificationSubscription ToNotificationSubscription(this NotificationSubscriptionInfo subscriptionInfo)
        {
            var entityType = subscriptionInfo.EntityTypeAssemblyQualifiedName.IsNullOrEmpty()
                ? null
                : Type.GetType(subscriptionInfo.EntityTypeAssemblyQualifiedName);

            return(new NotificationSubscription
            {
                UserId = subscriptionInfo.UserId,
                NotificationName = subscriptionInfo.NotificationName,
                EntityType = entityType,
                EntityTypeName = subscriptionInfo.EntityTypeName,
                EntityId = subscriptionInfo.EntityId.IsNullOrEmpty() ? null : JsonConvert.DeserializeObject(subscriptionInfo.EntityId, EntityHelper.GetPrimaryKeyType(entityType))
            });
        }
 public Task InsertSubscriptionAsync(NotificationSubscriptionInfo subscription)
 {
     return(Task.FromResult(0));
 }
 public void InsertSubscription(NotificationSubscriptionInfo subscription)
 {
 }
Пример #6
0
 public virtual Task InsertSubscriptionAsync(NotificationSubscriptionInfo subscription)
 {
     return(_notificationSubscriptionRepository.InsertAsync(subscription));
 }