Example #1
0
        public static Subscription CreateSubscription(string name, string email, bool isconfirmed, Post post)
        {
            var subscription = new Subscription();

            subscription.SubscriberName    = name;
            subscription.SubscriberEmail   = email;
            subscription.IsConfirmed       = isconfirmed;
            subscription.ConfirmationToken = GenerateToken();
            subscription.DateCreated       = DateTime.UtcNow;
            subscription.SubscriptionType  = SubscriptionType.Comments;
            subscription.AddPost(post);
            return(subscription);
        }