Пример #1
0
        public static async Task CheckAndCreateSubscription(Models.Transfer transfer)
        {
            var subscriptions = await _subscriptionHelper.GetSubscriptionsAsync(transfer.CustomerId);

            var doesSubscriptionExist = subscriptions != null && subscriptions.Any(x =>
                                                                                   x.CustomerId == transfer.CustomerId &&
                                                                                   x.TouchPointId == transfer.TargetTouchpointId);

            if (doesSubscriptionExist == false)
            {
                await _subscriptionHelper.CreateSubscriptionAsync(transfer);
            }
        }
 public static async Task AutoSubscribeCustomer(Models.Customer customer)
 {
     //Auto subscribe last modified touchpoint to the newly posted customer
     await _subscriptionHelper.CreateSubscriptionAsync(customer);
 }