/// <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); }
/// <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); }
public void SaveChanges() { //_transaction.Commit(); _observer.Released(this, true); _observer = null; }
public FakeUnitOfWork(IUnitOfWorkObserver observer, IDbTransaction transaction) { _observer = observer; _observer.Create(this); _transaction = transaction; }
/// <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; }
/// <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; }
public void SetObserver(IUnitOfWorkObserver observer) { _observer = 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) { _observerAdapter.SetObserver(observer); }
public UowAdapter(IDocumentSession session, IUnitOfWorkObserver observer) : base(session, observer) { }