public void Should_Assign_Correct_Session_Arg()
        {
            var session = new Mock<ISession>().Object;
            var entity = new Mock<IEntity>().Object;

            var args = new EntitySavingEventArgs(entity, session);

            Assert.AreEqual(args.Session, session);
            Assert.AreEqual(args.Entity, entity);
        }
예제 #2
0
 private void OnEntitySave(EntitySavingEventArgs args)
 {
     using (var container = ContextScopeProvider.CreateChildContainer())
     {
         if (args.Session == null || args.Session.IsDirtyEntity(args.Entity))
         {
             var tracker = container.Resolve<IEntityTrackingService>();
             tracker.OnEntityUpdate(args.Entity);
         }
     }
 }
예제 #3
0
 void Instance_EntitySaving(EntitySavingEventArgs args)
 {
     firedSave ++;
 }