예제 #1
0
        /// <summary>
        /// Adds new message to database
        /// </summary>
        /// <param name="message"></param>
        public void Add(Message message)
        {
            message.DateCreated = DateTime.UtcNow;

            using (var session = GetSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    session.Save(message);
                    transaction.Commit();
                }
            }
        }
예제 #2
0
 public Message Post(Message message)
 {
     Repository.Add(message);
     return message;
 }