Ejemplo n.º 1
0
        protected override void invoke(Action action)
        {
            action();
            _session.SaveChanges();

            // TODO -- add in logging later
        }
Ejemplo n.º 2
0
 protected override void invoke(Action action)
 {
     action();
     _session.SaveChanges();
     _session.WithOpenSession(x =>
                              _logger.DebugMessage(() =>
                                                   TransactionalBehaviorRavenSessionUsageMessage.For(x, _httpRequest)));
 }
Ejemplo 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;
            }
        }
Ejemplo 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();
 }