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 { TenantId = subscriptionInfo.TenantId, UserId = subscriptionInfo.UserId, NotificationName = subscriptionInfo.NotificationName, EntityType = entityType, EntityTypeName = subscriptionInfo.EntityTypeName, EntityId = subscriptionInfo.EntityId.IsNullOrEmpty() ? null : JsonConvert.DeserializeObject(subscriptionInfo.EntityId, EntityHelper.GetPrimaryKeyType(entityType)), CreationTime = subscriptionInfo.CreationTime }); }
public Task InsertSubscriptionAsync(NotificationSubscriptionInfo subscription) { return(Task.FromResult(0)); }