private static HandlerSequence GetHandlerSequence(ISessionFactory sessionFactory, string name)
        {
            var session = sessionFactory.GetCurrentSession();
            var sequence = session.Get<HandlerSequence>(name);
            if (sequence != null)
                return sequence;

            sequence = new HandlerSequence(name);
            session.Save(sequence);
            return sequence;
        }
        private static HandlerSequence GetHandlerSequence(ISessionFactory sessionFactory, string name)
        {
            var session  = sessionFactory.GetCurrentSession();
            var sequence = session.Get <HandlerSequence>(name);

            if (sequence != null)
            {
                return(sequence);
            }

            sequence = new HandlerSequence(name);
            session.Save(sequence);
            return(sequence);
        }