public T ExecuteWithLazySessionScopeContexts <T>(Expression <Func <TodoItemsService2, T> > scenarioExpression) { using (var todoItemsContext = new TodoItemsContext(_lazySessionsScoper.ScopeFor <TodoItems>())) using (var usersContext = new UsersContext(_lazySessionsScoper.ScopeFor <Users>())) { return(executeWithContexts(scenarioExpression, todoItemsContext, usersContext)); } }
public T ExecuteWithSessionFuncContexts <T>(Expression <Func <TodoItemsService2, T> > scenarioExpression) { using (var todoItemsContext = new TodoItemsContext(() => _lazySessionFactories.ValueFor <TodoItems>().OpenSession())) using (var usersContext = new UsersContext(() => _lazySessionFactories.ValueFor <Users>().OpenSession())) { return(executeWithContexts(scenarioExpression, todoItemsContext, usersContext)); } }