Beispiel #1
0
 void Trigger <T>(SubscribersCollection <System.Func <T, bool> > listeners, T val)
 {
     foreach (var listener in listeners.Subscribers)
     {
         if (listener(val))
         {
             break;
         }
     }
 }
        public void SendNewsletterToSubscribers()
        {
            SubscribersCollection = _context.GetSubscribersList();

            Subscribers = SubscribersCollection.Find(new BsonDocument()).ToList();

            Parallel.ForEach(Subscribers, subscriber =>
            {
                SendSubscriberEmail(subscriber);
            });
        }