Exemplo n.º 1
0
 public void NotifyUsersAboutNewSubmission(Submission submission)
 {
     _pubnub.Publish(Channel, Serialize(new PubNubMessage("PostChannel", submission)));
 }
Exemplo n.º 2
0
        private Submission CreateSubmission(string url)
        {
            var submission = new Submission()
                             	{
                             		Href = url,
                             		WhenGmt = DateTime.UtcNow,
                             		Score = 1
                             	};

            using (var session = OrmHost.CreateSessionFactory().OpenSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    transaction.Begin();

                    session.SaveOrUpdate(submission);

                    transaction.Commit();
                }
            }

            return submission;
        }