Ejemplo n.º 1
0
        public void DeleteSubscription(string subscriberemail, SubscriptionType type)
        {
            Subscription subscription = SubscriptionRepository.Get(s => s.SubscriberEmail == subscriberemail).FirstOrDefault(s => s.SubscriptionType == type);

            if (subscription != null)
            {
                foreach (NewsletterTask task in subscription.NewsletterTasks.ToList())
                {
                    NewsletterRepository.DeleteNewsletterTask(task);
                }
                SubscriptionRepository.Delete(subscription);
                SubscriptionRepository.UnitOfWork.Commit();
            }
        }
Ejemplo n.º 2
0
 public void DeleteNewsletterTask(NewsletterTask task)
 {
     NewsletterRepository.DeleteNewsletterTask(task);
     NewsletterRepository.UnitOfWork.Commit();
 }