public static void WithSessionTx(Action <ISession> code) { using (var p = new Persistenz()) { code.Invoke(p.Session); p.Commit(); } }
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); }