public EventSourceController(ICommandManager commandManager)
        {
            _commandManager = commandManager;

            // set this one to eventsourced for testing

            // you would normally do this in DI, but we're supporting different
            // implementations here side-by-side for demonstration purposes
            _companyStateRepository = new EventSourcedMainRepository();
            _companyService         = new CompanyService(_companyStateRepository, new DateTimeProvider());
            _contactStateRepository = new EventSourcedMainRepository();
            _contactService         = new ContactService(_contactStateRepository, new DateTimeProvider());
            _projectStateRepository = new EventSourcedMainRepository();
            _projectService         = new ProjectService(_projectStateRepository, new DateTimeProvider());
            _productStateRepository = new EventSourcedMainRepository();
            _productService         = new ProductService(_productStateRepository, new DateTimeProvider());
            ConfigureCommandManager();
        }
 public ProductApplicationService(IEventStore eventStore, IProductStateRepository stateRepository, IProductStateQueryRepository stateQueryRepository)
 {
     this._eventStore           = eventStore;
     this._stateRepository      = stateRepository;
     this._stateQueryRepository = stateQueryRepository;
 }
 public ProductService(IProductStateRepository repo, IDateTimeProvider dateTimeProvider)
 {
     _repo             = repo;
     _dateTimeProvider = dateTimeProvider;
 }
Exemple #4
0
 public ProductsController(IProductStateRepository productStateRepository)
 {
     _productStateRepository = productStateRepository;
 }