/// <summary> /// Construct my final state with the <see cref="IStateStore"/>, which must /// be provided by my concrete extenders, as well as with a /// <see cref="IStateAdapter"/> and a <see cref="IEntryAdapter{TSource,TEntry}"/>. /// </summary> /// <param name="stateStore">The <see cref="IStateStore"/> from which previous state is read and merged current state is written</param> /// <param name="stateAdapter">The <see cref="IStateAdapter"/> used by my extenders to adapt persistent state</param> /// <param name="entryAdapter">The <see cref="IEntryAdapter{TSource,TEntry}"/> used by my extenders to adapt persistent entries</param> public StateStoreProjectionActor(IStateStore stateStore, IStateAdapter stateAdapter, IEntryAdapter entryAdapter) { _stateStore = stateStore; _stateAdapter = stateAdapter; _entryAdapter = entryAdapter; _readInterest = SelfAs <IReadResultInterest>(); _writeInterest = SelfAs <IWriteResultInterest>(); _adaptedSources = new List <ISource>(); }
public Info RegisterStateAdapter <TSource, TState>(IStateAdapter <Source <TSource>, State <TState> > adapter, Action <Type, IStateAdapter <Source <TSource>, State <TState> > > consumer) { StateAdapterProvider.RegisterAdapter(adapter, consumer); return(this); }
public Info RegisterStateAdapter <TSource, TState>(IStateAdapter <Source <TSource>, State <TState> > adapter) { StateAdapterProvider.RegisterAdapter(adapter); return(this); }