public void ResetEventArgs() { TransactionOpenArgs = null; TransactionPrecommitingArgs = null; TransactionCommitingArgs = null; TransactionCommitedArgs = null; TransactionRollbackingArgs = null; TransactionRollbackedArgs = null; PersistingArgs = null; PersistedArgs = null; ChangesCancelingArgs = null; ChangesCanceledArgs = null; EntityCreatedArgs = null; EntityRemoving = null; EntityRemoved = null; EntityFieldGettingArgs = null; EntityFieldValueGetArgs = null; EntityFieldValueSettingArgs = null; EntityFieldValueSetArgs = null; QueryExecuting = null; QueryExecuted = null; DbCommandExecuting = null; DbCommandExecuted = null; }
public void MainTest() { using (var session = Domain.OpenSession()) { session.Events.TransactionOpening += (sender, e) => transactionOpenArgs = e; session.Events.TransactionCommitting += (sender, e) => { transactionCommitingArgs = e; if (throwExceptionOnCommit) { throw new TestException(); } }; session.Events.TransactionCommitted += (sender, e) => transactionCommitedArgs = e; session.Events.TransactionRollbacking += (sender, e) => transactionRollbackingArgs = e; session.Events.TransactionRollbacked += (sender, e) => transactionRollbackedArgs = e; session.Events.Persisting += (sender, e) => persistingArgs = e; session.Events.Persisted += (sender, e) => persistedArgs = e; session.Events.EntityCreated += (sender, e) => entityCreatedArgs = e; session.Events.EntityRemoving += (sender, e) => entityRemoving = e; session.Events.EntityRemove += (sender, e) => entityRemoved = e; session.Events.EntityFieldValueGetting += (sender, e) => entityEntityFieldGettingArgs = e; session.Events.EntityFieldValueGet += (sender, e) => entityEntityFieldArgs = e; session.Events.EntityFieldValueSetting += (sender, e) => entityEntityFieldSettingArgs = e; session.Events.EntityFieldValueSet += (sender, e) => entityEntityFieldSetArgs = e; CommitTransaction(); RollbackTransaction(); ErrorOnCommit(); EditEntity(); } }
private void ClearEvents() { transactionOpenArgs = null; transactionCommitingArgs = null; transactionCommitedArgs = null; transactionRollbackingArgs = null; transactionRollbackedArgs = null; persistingArgs = null; persistedArgs = null; entityCreatedArgs = null; entityRemoving = null; entityRemoved = null; entityEntityFieldGettingArgs = null; entityEntityFieldArgs = null; entityEntityFieldSettingArgs = null; entityEntityFieldSetArgs = null; }
private void OnEntityFieldValueGetting(object sender, EntityFieldEventArgs e) => EntityFieldGettingArgs = e;