Beispiel #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);
        }
Beispiel #2
0
 public SingleStateUpdater(IStateMonitor <TId, TEntity> notifier, IIgnitorStore <TId, TEntity> store, TId id)
 {
     _notifier = (IStateSignaling <TId, TEntity>)notifier;
     _store    = store;
     _id       = id;
 }
Beispiel #3
0
 public StateUpdater(IStateMonitor <TId, TEntity> notifier, IIgnitorStore <TId, TEntity> store)
 {
     _notifier = (IStateSignaling <TId, TEntity>)notifier;
     _store    = store;
 }