/// <summary>
 /// Creates a new instance of <see cref="NHibernateProjector{TProjection,TKey,TState}"/>.
 /// </summary>
 /// <param name="sessionFactory">The delegate that creates a new <see cref="ISession"/>.</param>
 /// <param name="mapBuilder">
 /// The <see cref="IEventMapBuilder{TProjection,TKey,TContext}"/>
 /// with already configured handlers for all the required events
 /// but not yet configured how to handle custom actions, projection creation, updating and deletion.
 /// The <see cref="IEventMap{TContext}"/> will be created from it.
 /// </param>
 /// <param name="children">An optional collection of <see cref="INHibernateChildProjector"/> which project events
 /// in the same transaction just before the parent projector.</param>
 public NHibernateProjector(
     Func <ISession> sessionFactory,
     IEventMapBuilder <TProjection, TKey, NHibernateProjectionContext> mapBuilder, Action <TProjection, TKey> setIdentity,
     IEnumerable <INHibernateChildProjector> children = null)
 {
     this.sessionFactory = sessionFactory;
     mapConfigurator     = new NHibernateEventMapConfigurator <TProjection, TKey>(mapBuilder, setIdentity, children);
 }
Пример #2
0
 /// <summary>
 /// Creates a new instance of <see cref="NHibernateChildProjector{TProjection,TKey}"/>.
 /// </summary>
 /// <param name="mapBuilder">
 /// The <see cref="IEventMapBuilder{TProjection,TKey,TContext}"/>
 /// with already configured handlers for all the required events
 /// but not yet configured how to handle custom actions, projection creation, updating and deletion.
 /// The <see cref="IEventMap{TContext}"/> will be created from it.
 /// </param>
 /// <param name="children">An optional collection of <see cref="INHibernateChildProjector"/> which project events
 /// in the same transaction just before the parent projector.</param>
 public NHibernateChildProjector(
     IEventMapBuilder <TProjection, TKey, NHibernateProjectionContext> mapBuilder,
     IEnumerable <INHibernateChildProjector> children = null)
 {
     mapConfigurator = new NHibernateEventMapConfigurator <TProjection, TKey>(mapBuilder, children);
 }