Пример #1
0
        public static void WithSessionTx(Action <ISession> code)
        {
            using (var p = new Persistenz())
            {
                code.Invoke(p.Session);

                p.Commit();
            }
        }
Пример #2
0
        public static T WithSessionTxRs <T>(Func <ISession, T> code)
        {
            T result = default(T);

            using (var p = new Persistenz())
            {
                result = code.Invoke(p.Session);

                p.Commit();
            }

            return(result);
        }