public InMemorySagaRepository() { _sagas = new IndexedSagaDictionary <TSaga>(); var factory = new InMemorySagaConsumeContextFactory <TSaga>(); var repositoryContextFactory = new InMemorySagaRepositoryContextFactory <TSaga>(_sagas, factory); _repository = new SagaRepository <TSaga>(repositoryContextFactory); }
ISagaRepository <T> CreateInMemorySagaRepository <T>() where T : class, ISaga { var dictionary = new IndexedSagaDictionary <T>(); ISagaConsumeContextFactory <IndexedSagaDictionary <T>, T> factory = new InMemorySagaConsumeContextFactory <T>(); ISagaRepositoryContextFactory <T> repositoryContextFactory = new InMemorySagaRepositoryContextFactory <T>(dictionary, factory); return(new SagaRepository <T>(repositoryContextFactory)); }