protected override void invoke(Action action)
        {
            action();
            _session.SaveChanges();

            // TODO -- add in logging later
        }
Esempio n. 2
0
 protected override void invoke(Action action)
 {
     action();
     _session.SaveChanges();
     _session.WithOpenSession(x =>
                              _logger.DebugMessage(() =>
                                                   TransactionalBehaviorRavenSessionUsageMessage.For(x, _httpRequest)));
 }
Esempio n. 3
0
        protected override async Task invoke(Func <Task> func)
        {
            try
            {
                await func().ConfigureAwait(false);

                await _session.SaveChanges().ConfigureAwait(false);
            }
            catch (Exception)
            {
                _session.Dispose();

                throw;
            }
        }
Esempio n. 4
0
        public void load_all()
        {
            persistor.Persist(new User());
            persistor.Persist(new User());
            persistor.Persist(new User());
            persistor.Persist(new OtherEntity());
            persistor.Persist(new OtherEntity());
            persistor.Persist(new ThirdEntity());

            boundary.SaveChanges();

            persistor.LoadAll <User>().Count().ShouldEqual(3);
            persistor.LoadAll <OtherEntity>().Count().ShouldEqual(2);
            persistor.LoadAll <ThirdEntity>().Count().ShouldEqual(1);
        }
 protected override void invoke(Action action)
 {
     action();
     _session.SaveChanges();
 }