public DocumentAppService( IProjectRepository projectRepository, IDocumentStoreFactory documentStoreFactory) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; }
/// <summary> /// Create SubscriptionService and configure it from configuration file. /// </summary> /// <param name="subscriptionStoreFactory"></param> public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager) { Initialize(subscriptionStoreFactory, routeManager, MessageBusSettings.Settings.InputQueue); foreach (MessageBusSettings.MessageRoute route in MessageBusSettings.Settings.Routes) { RouteManager.AddRoute(route.Messages, route.Destination); } }
/// <summary> /// 构造函数 ///</summary> public ProjectAppService( IRepository <Project, Guid> entityRepository , IProjectManager entityManager, ICacheManager cacheManager, IDocumentStoreFactory documentStoreFactory) { _projectRepository = entityRepository; _projectManager = entityManager; _cacheManager = cacheManager; _documentStoreFactory = documentStoreFactory; }
public EventStorePublisher(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory) { Condition.Requires(store, "store").IsNotNull(); Condition.Requires(publisher, "publisher").IsNotNull(); EventStore = store; EventPublisher = publisher; LastPublishedIdRepository = new DocumentRepository(documentStoreFactory); }
public DocumentAppService( IProjectRepository projectRepository, IDistributedCache <List <string> > distributedCache, IDocumentStoreFactory documentStoreFactory) { _projectRepository = projectRepository; _distributedCache = distributedCache; _documentStoreFactory = documentStoreFactory; }
protected void Initialize(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName) { Condition.Requires(subscriptionStoreFactory, "subscriptionStoreFactory").IsNotNull(); Condition.Requires(inputQueueName, "inputQueueName").IsNotNull(); Condition.Requires(routeManager, "routeManager").IsNotNull(); RouteManager = routeManager; Subscriptions = subscriptionStoreFactory.Create <Type, SubscriptionRegistration>(); InputQueueName = inputQueueName; }
public EventStorePublisher(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory) { Condition.Requires(store, "store").IsNotNull(); Condition.Requires(publisher, "publisher").IsNotNull(); EventStore = store; EventPublisher = publisher; LastPublishedIdRepository = new DocumentRepository(documentStoreFactory); }
public ProjectAppService( IProjectRepository projectRepository, IDistributedCache <List <VersionInfo> > versionCache, IDocumentStoreFactory documentStoreFactory) { _projectRepository = projectRepository; _versionCache = versionCache; _documentStoreFactory = documentStoreFactory; }
public EventStoreHost(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory) { Condition.Requires(store, "store").IsNotNull(); Condition.Requires(publisher, "publisher").IsNotNull(); EventStore = store; EventPublisher = publisher; DocumentStoreFactory = documentStoreFactory; EventStorePublisher = new EventStorePublisher(store, publisher, documentStoreFactory); }
public static IDocumentStoreFactory GetSubscriptionStore(AbstractConfiguration cfg) { IDocumentStoreFactory store = cfg.Get <IDocumentStoreFactory>(SubscriptionStoreFactory_SettingsKey); if (store == null) { throw new InvalidOperationException(string.Format("No message bus subscription store has been configured.")); } return(store); }
public DocumentAppService( IRepository <Project, Guid> projectRepository, IDocumentStoreFactory documentStoreFactory, ICacheManager cacheManager ) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; _cacheManager = cacheManager; }
public EventStoreHost(IEventStore store, IEventPublisher publisher, IDocumentStoreFactory documentStoreFactory) { Condition.Requires(store, "store").IsNotNull(); Condition.Requires(publisher, "publisher").IsNotNull(); EventStore = store; EventPublisher = publisher; DocumentStoreFactory = documentStoreFactory; EventStorePublisher = new EventStorePublisher(store, publisher, documentStoreFactory); }
public static IDocumentStoreFactory GetDocumentStoreFactory(AbstractConfiguration cfg) { IDocumentStoreFactory docStoreFactory = cfg.Get <IDocumentStoreFactory>(DocumentStoreFactory_SettingsKey); if (docStoreFactory == null) { throw new InvalidOperationException("Missing document store factory for event store."); } return(docStoreFactory); }
public DocumentAppService( IProjectRepository projectRepository, IDocumentStoreFactory documentStoreFactory, IDistributedCache <DocumentWithDetailsDto> documentCache, IDistributedCache <DocumentResourceDto> resourceCache) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; DocumentCache = documentCache; ResourceCache = resourceCache; }
public PrintPersonDetailsViewModel(IDocumentStoreFactory documentStoreFactory, IMessageDialogService messageDialogService) { _documentStoreFactory = documentStoreFactory; _messageDialogService = messageDialogService; AddSelectedToSelectedPersonsCommand = new RelayCommand(AddSelectedToSelectedPersons, CanAddSelectedToSelectedPersons); RemoveSelectedFromSelectedPersonsCommand = new RelayCommand(RemoveSelectedFromSelectedPersons, CanRemoveSelectedFromSelectedPersons); PrintPersonDetailCommand = new RelayCommand(PrintPersonDetail); SelectedPersons = new ObservableCollection <PersonViewModel>(); InitializePersons(); }
public RaventEventStorage(IDocumentStoreFactory storeFactory, IBus eventBus) { _documentStore = storeFactory.BuildStore; using (var session = _documentStore.OpenSession()) { foreach (var @event in GetAllEvents(session) //.OrderByDescending(x => (x as Event).Date) ) { eventBus.Raise(@event); } } }
private static EventStoreHost BuildEventStoreHost(BaseConfiguration cfg, IMessageBus messageBus) { IEventPublisher eventPublisher = EventStoreConfigurationExtensions.GetEventPublisher(cfg, false); if (eventPublisher == null) { eventPublisher = new MessageBusEventPublisher(messageBus); } IDocumentStoreFactory docStoreFactory = EventStoreConfigurationExtensions.GetDocumentStoreFactory(cfg); EventStoreDB eStore = EventStoreConfigurationExtensions.GetEventStoreDB(cfg); EventStoreHost host = new EventStoreHost(eStore, eventPublisher, docStoreFactory); return(host); }
public KindManager(IResourceDocumentStore <Kind> documentStore, IDocumentStoreFactory documentStoreFactory, ResourceManagerContainer resourceManagerAccessor, ResourceManagerContainer resourceManagers) : base(documentStore, resourceManagers) { _documentStoreFactory = documentStoreFactory; _resourceManagerAccessor = resourceManagerAccessor; _resourceManagers = resourceManagers; AddResource(CoreKinds.Kind); AddResource(CoreKinds.Host); AddResource(CoreKinds.Controller); AddResource(CoreKinds.Device); }
public DocumentAppService( IProjectRepository projectRepository, IDocumentStoreFactory documentStoreFactory, IDistributedCache <DocumentWithDetailsDto> documentCache, IDistributedCache <LanguageConfig> languageCache, IDistributedCache <DocumentResourceDto> resourceCache, IHostEnvironment hostEnvironment) { _projectRepository = projectRepository; _documentStoreFactory = documentStoreFactory; DocumentCache = documentCache; LanguageCache = languageCache; ResourceCache = resourceCache; HostEnvironment = hostEnvironment; }
public PersonViewModel(IMessageDialogService messageDialogService, IDocumentStoreFactory documentStoreFactory, Person person, IChangeListener parent) { if (person == null) { person = new Person(); } _documentStoreFactory = documentStoreFactory; _messageDialogService = messageDialogService; _person = person; _parent = parent; CopyFromEntity(person); AddDocumentCommand = new RelayCommand(AddDocument, CanAddDocument); RemoveDocumentsCommand = new RelayCommand(RemoveDocuments, CanRemoveDocuments); }
/// <summary> /// No more configuration needed for message bus - now configure something else or start the bus. /// </summary> /// <param name="cfg"></param> /// <returns></returns> public static BaseConfiguration Done(this MessageBusConfiguration cfg) { IObjectContainer container = ObjectContainerConfigurationExtensions.GetObjectContainer(cfg); IDocumentStoreFactory subscriptionStoreFactory = GetSubscriptionStore(cfg); if (!container.HasComponent(typeof(IRouteManager))) { container.AddComponent <IRouteManager, RouteManager>(); } IRouteManager routeManager = container.Resolve <IRouteManager>(); ISubscriptionService subscriptionService = new SubscriptionService(subscriptionStoreFactory, routeManager); cfg.Set(SubscriptionService_SettingsKey, subscriptionService); container.RegisterInstance <ISubscriptionService>(subscriptionService); return(new BaseConfiguration(cfg)); }
public MainViewModel(IDocumentStoreFactory documentStoreFactory, IDispatcher dispatcher, IMessageDialogService messageDialogService, IExcelImportService excelImportService, IExcelExportService excelExportService) { _documentStoreFactory = documentStoreFactory; _dispatcher = dispatcher; _messageDialogService = messageDialogService; _excelImportService = excelImportService; _excelExportService = excelExportService; NewCommand = new RelayCommand(CreateNewPerson); SaveCommand = new RelayCommand(SaveSelectedPerson, CanSaveSelectedPerson); DeleteCommand = new RelayCommand(DeleteSelectedPerson, CanDeleteSelectedPerson); RevertCommand = new RelayCommand(RevertChanges, CanRevertChanges); ImportCommand = new RelayCommand(ImportPersons); ExportCommand = new RelayCommand(ExportPersons); PrintPersonDetailCommand = new RelayCommand(PrintPersonDetail); ToggleFilter = new RelayCommand(TogglePersonsFilter, CanTogglePersonsFilter); InitializePersons(); }
public CqrsDocumentStoreFactory( IAddDocumenStoreFromParameters storeAdder, IDocumentStoreFactory documentStoreFactory, ICqrsDocumentStoreFactoryInitializer initializer = null) { this.documentStoreFactory = documentStoreFactory; storeAdder.AddStore( new DocumentStoreParameters { DatabaseName = "EventStore", FindTypeTagName = type => typeof(AbstractEvent).Name, TransformTypeTagNameToDocumentKeyPrefix = s => null }); IndexCreation.CreateIndexes(typeof(AbstractEvent_EventSourcedIdAndVersion).Assembly, this.EventStore); storeAdder.AddStore(new DocumentStoreParameters { DatabaseName = "ReadModel", FindIdentityPropertyNameFromEntityName = n => n + "Id", }); storeAdder.AddStore(new DocumentStoreParameters { DatabaseName = "SagaStore", FindIdentityPropertyNameFromEntityName = n => "CorrelationId" }); if (initializer == null) { return; } initializer.SetDocumentStoreFactory(this); initializer.Initialize(); }
public TwitterDocumentStore(IDocumentStoreFactory documentStoreFactory) { _documentStore = documentStoreFactory.CreateDocumentStore(); }
public DocumentStoreAdapter(IDocumentStoreFactory factory) { _factory = factory; }
public AccessTokenDocumentStore(IDocumentStoreFactory documentStoreFactory) { _documentStore = documentStoreFactory.GetDocumentStore(); }
public ExcelImportService(IDocumentStoreFactory documentStoreFactory) { _documentStoreFactory = documentStoreFactory; }
/// <summary> /// Create SubscriptionService with empty message routing and supplied input queue name. /// </summary> /// <param name="subscriptionStoreFactory"></param> /// <param name="inputQueueName"></param> public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName) { Initialize(subscriptionStoreFactory, routeManager, inputQueueName); }
public DocumentRepository(IDocumentStoreFactory factory) { Condition.Requires(factory, "factory").IsNotNull(); Factory = factory; }
/// <summary> /// Create SubscriptionService with empty message routing and supplied input queue name. /// </summary> /// <param name="subscriptionStoreFactory"></param> /// <param name="inputQueueName"></param> public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName) { Initialize(subscriptionStoreFactory, routeManager, inputQueueName); }
/// <summary> /// Create SubscriptionService and configure it from configuration file. /// </summary> /// <param name="subscriptionStoreFactory"></param> public SubscriptionService(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager) { Initialize(subscriptionStoreFactory, routeManager, MessageBusSettings.Settings.InputQueue); foreach (MessageBusSettings.MessageRoute route in MessageBusSettings.Settings.Routes) RouteManager.AddRoute(route.Messages, route.Destination); }
public TwitterDocumentStore(IDocumentStoreFactory documentStoreFactory) { _documentStore = documentStoreFactory.GetDocumentStore(); }
public DocumentStoreFactory_Tests() { _documentStoreFactory = GetRequiredService <IDocumentStoreFactory>(); }
protected void Initialize(IDocumentStoreFactory subscriptionStoreFactory, IRouteManager routeManager, QueueName inputQueueName) { Condition.Requires(subscriptionStoreFactory, "subscriptionStoreFactory").IsNotNull(); Condition.Requires(inputQueueName, "inputQueueName").IsNotNull(); Condition.Requires(routeManager, "routeManager").IsNotNull(); RouteManager = routeManager; Subscriptions = subscriptionStoreFactory.Create<Type, SubscriptionRegistration>(); InputQueueName = inputQueueName; }
public ReadOnlyRavenEventStorage(IDocumentStoreFactory storeFactory, IBus eventBus) : base(storeFactory, eventBus) { }
public GithubDocumentStore_Tests() { _documentStoreFactory = GetRequiredService <IDocumentStoreFactory>(); _projectRepository = GetRequiredService <IProjectRepository>(); _testData = GetRequiredService <DocsTestData>(); }
/// <summary> /// Initializes a new instance of the <see cref="TaskRepository"/> class. /// </summary> /// <param name="documentStore">The documentStore.</param> public TaskRepository(IDocumentStoreFactory documentStore) { this._documentStore = documentStore; }
public CategoriesController(IDocumentStoreFactory storeFactory) { this.storeFactory = storeFactory; }
public SuppliersController(IDocumentStoreFactory storeFactory) { this.storeFactory = storeFactory; }