/// <summary>
 /// Initializes a new instance of the <see cref="RavenDbUnitOfWork" /> class.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="observer">The observer.</param>
 /// <exception cref="System.ArgumentNullException">session</exception>
 public RavenDbUnitOfWork(IDocumentSession session, IUnitOfWorkObserver observer)
 {
     if (session == null) throw new ArgumentNullException("session");
     Session = session;
     _observer = observer;
     _observer.Create(this);
 }
Example #2
0
 /// <summary>
 /// Register our own observer which is used to control when the domain events are dispatched.
 /// </summary>
 /// <param name="observer">Our observer.</param>
 public void Register(IUnitOfWorkObserver observer)
 {
     if (observer == null)
     {
         throw new ArgumentNullException("observer");
     }
     _observer = observer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RavenDbUnitOfWork" /> class.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="observer">The observer.</param>
 /// <exception cref="System.ArgumentNullException">session</exception>
 public RavenDbUnitOfWork(IDocumentSession session, IUnitOfWorkObserver observer)
 {
     if (session == null)
     {
         throw new ArgumentNullException("session");
     }
     Session   = session;
     _observer = observer;
     _observer.Create(this);
 }
Example #4
0
 public void SaveChanges()
 {
     //_transaction.Commit();
     _observer.Released(this, true);
     _observer = null;
 }
Example #5
0
 public FakeUnitOfWork(IUnitOfWorkObserver observer, IDbTransaction transaction)
 {
     _observer = observer;
     _observer.Create(this);
     _transaction = transaction;
 }
Example #6
0
 public void SaveChanges()
 {
     //_transaction.Commit();
     _observer.Released(this, true);
     _observer = null;
 }
Example #7
0
 public FakeUnitOfWork(IUnitOfWorkObserver observer, IDbTransaction transaction)
 {
     _observer = observer;
     _observer.Create(this);
     _transaction = transaction;
 }
Example #8
0
 /// <summary>
 /// Register our own observer which is used to control when the domain events are dispatched.
 /// </summary>
 /// <param name="observer">Our observer.</param>
 public void Register(IUnitOfWorkObserver observer)
 {
     Observer = observer;
 }
Example #9
0
 /// <summary>
 /// Register our own observer which is used to control when the domain events are dispatched.
 /// </summary>
 /// <param name="observer">Our observer.</param>
 public void Register(IUnitOfWorkObserver observer)
 {
     if (observer == null) throw new ArgumentNullException("observer");
     _observer = observer;
 }
Example #10
0
 public void SetObserver(IUnitOfWorkObserver observer)
 {
     _observer = observer;
 }
Example #11
0
 /// <summary>
 /// Register our own observer which is used to control when the domain events are dispatched.
 /// </summary>
 /// <param name="observer">Our observer.</param>
 public void Register(IUnitOfWorkObserver observer)
 {
     _observerAdapter.SetObserver(observer);
 }
Example #12
0
 public UowAdapter(IDocumentSession session, IUnitOfWorkObserver observer)
     : base(session, observer)
 {
 }
 /// <summary>
 /// Register our own observer which is used to control when the domain events are dispatched.
 /// </summary>
 /// <param name="observer">Our observer.</param>
 public void Register(IUnitOfWorkObserver observer)
 {
     Observer = observer;
 }