/// <summary> /// Set the message delivered to the specified subscriber /// </summary> /// <param name="s">subscriber message was sent to</param> public void AddDelivery(Subscriber s) { var queueQuery = from q in Content.Subscribers where q.contact == s.contact select q; // Delete subscriber from queue for this mailing objectContext.DeleteObject(queueQuery.First()); objectContext.SaveChanges(); }
/// <inheritdoc /> public int AddSubscriber(string authKey, DataTransferObject.SubscriberDto s) { if (!IsAuthenticatedKey(authKey)) { return 0; } using (var context = new NewsletterEntities()) { var subscriber = new Subscriber(); var sessions = new SessionManager(context); subscriber.name = s.Name; subscriber.contact = s.Contact; subscriber.newsletter = sessions.GetSession(authKey).NewsletterId; context.Subscribers.AddObject(subscriber); context.SaveChanges(); return subscriber.id; } }
/// <summary> /// Create a new Subscriber object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="contact">Initial value of the contact property.</param> /// <param name="newsletter">Initial value of the newsletter property.</param> public static Subscriber CreateSubscriber(global::System.Int32 id, global::System.String name, global::System.String contact, global::System.Int32 newsletter) { Subscriber subscriber = new Subscriber(); subscriber.id = id; subscriber.name = name; subscriber.contact = contact; subscriber.newsletter = newsletter; return subscriber; }
/// <summary> /// Deprecated Method for adding a new object to the Subscribers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSubscribers(Subscriber subscriber) { base.AddObject("Subscribers", subscriber); }