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); }
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); } } }
void Instance_EntitySaving(EntitySavingEventArgs args) { firedSave ++; }