Exemple #1
0
 /// <summary>
 /// Publishes the pre-commit notification.
 /// </summary>
 /// <param name="args"></param>
 public void PreCommit(EntityChangeSetPreCommitArgs args)
 {
     foreach (var listener in _listeners)
     {
         // do not catch exceptions thrown by PreCommit listeners
         // if any listener throws an exception, the commit should be aborted
         listener.PreCommit(args);
     }
 }
            public void PreCommit(EntityChangeSetPreCommitArgs args)
            {
                if (_invocationInfo == null || _invocationInfo.Count == 0)
                {
                    return;
                }

                var info = _invocationInfo.Peek();

                // store a copy of the change set for use by recorders,
                // and then invoke their PreCommit callback
                info.SetChangeSet(args.ChangeSet);
                info.PreCommit(args.PersistenceContext);
            }
        public void PreCommit(EntityChangeSetPreCommitArgs args)
        {
            foreach (var entityChange in args.ChangeSet.Changes)
            {
                if (entityChange.ChangeType != EntityChangeType.Create)
                {
                    continue;
                }

                if (entityChange.GetEntityClass() != typeof(TChangedEntityClass))
                {
                    continue;
                }

                SyncEnumValue(entityChange.EntityRef, args.PersistenceContext);
            }
        }