Exemple #1
0
        /// <summary>
        /// Scoped State constructor.
        /// This should be called by either the State object or the Dependency Injection system.
        /// </summary>
        /// <param name="parentState">The parent state to this scoped state</param>
        /// <param name="scopedStateFactory">The scope state factory</param>
        /// <param name="store">The dta store for this scoped state</param>
        /// <param name="monitor">The state monitor service for this scoped state</param>
        public ScopedState(IState parentState,
                           IScopedStateFactory scopedStateFactory,
                           IIgnitorStore <TId, TEntity> store,
                           IStateMonitor <TId, TEntity> monitor) :
            base(scopedStateFactory)
        {
            _parentState = parentState;

            _store   = store;
            _monitor = monitor;

            // Id selector defaults
            _idProperty = GetIdProperty();
            _idSelector = (entity) => (TId)_idProperty.GetValue(entity);
        }
Exemple #2
0
 public State(IScopedStateFactory scopedStateFactory)
 {
     _scopedStateFactory = scopedStateFactory;
 }