public AzureQueueStorageRepository(IRecorder recorder, string connectionString) { recorder.GuardAgainstNull(nameof(recorder)); connectionString.GuardAgainstNullOrEmpty(nameof(connectionString)); this.connectionString = connectionString; this.recorder = recorder; }
private SqlServerRepository(IRecorder recorder, string connectionString) { recorder.GuardAgainstNull(nameof(recorder)); connectionString.GuardAgainstNullOrEmpty(nameof(connectionString)); this.recorder = recorder; this.connectionString = connectionString; }
public GeneralQueueStorage(IRecorder recorder, IQueueository queueository) { recorder.GuardAgainstNull(nameof(recorder)); queueository.GuardAgainstNull(nameof(queueository)); this.recorder = recorder; this.queueository = queueository; this.queueName = typeof(TMessage).GetEntityNameSafe(); }
public GeneralReadModelStorage(IRecorder recorder, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); this.recorder = recorder; this.repository = repository; }
public GeneralCrudStorage(IRecorder recorder, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); this.recorder = recorder; this.repository = repository; this.containerName = typeof(TDto).GetEntityNameSafe(); }
public PersonEntityReadModelProjection(IRecorder recorder, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); this.recorder = recorder; this.personStorage = new GeneralReadModelStorage <Person>(recorder, repository); }
protected EventStreamHandlerBase(IRecorder recorder, params IEventNotifyingStorage[] eventingStorages) { recorder.GuardAgainstNull(nameof(recorder)); eventingStorages.GuardAgainstNull(nameof(eventingStorages)); this.recorder = recorder; this.eventingStorages = eventingStorages; ProcessingErrors = new List <EventProcessingError>(); }
public GeneralBlobStorage(IRecorder recorder, string containerName, IBlobository blobository) { recorder.GuardAgainstNull(nameof(recorder)); blobository.GuardAgainstNull(nameof(blobository)); containerName.GuardAgainstNull(nameof(containerName)); this.recorder = recorder; this.blobository = blobository; this.containerName = containerName; }
public CarEntityReadModelProjection(IRecorder recorder, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); this.recorder = recorder; this.carStorage = new GeneralReadModelStorage <Car>(recorder, repository); this.unavailabilityStorage = new GeneralReadModelStorage <Unavailability>(recorder, repository); }
private AzureCosmosSqlApiRepository(IRecorder recorder, string connectionString, string databaseName) { recorder.GuardAgainstNull(nameof(recorder)); connectionString.GuardAgainstNullOrEmpty(nameof(connectionString)); databaseName.GuardAgainstNullOrEmpty(nameof(databaseName)); this.recorder = recorder; this.connectionString = connectionString; this.databaseName = databaseName; }
public InProcessChangeEventNotificationSubscription(IRecorder recorder, IChangeEventMigrator migrator, IEnumerable <IDomainEventPublisherSubscriberPair> pubSubPairs, params IEventNotifyingStorage[] eventingStorages) : base(recorder, eventingStorages) { recorder.GuardAgainstNull(nameof(recorder)); migrator.GuardAgainstNull(nameof(migrator)); pubSubPairs.GuardAgainstNull(nameof(pubSubPairs)); this.notificationProducer = new DomainEventNotificationProducer(recorder, migrator, pubSubPairs.ToArray()); }
public GeneralQueryStorage(IRecorder recorder, IDomainFactory domainFactory, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); this.recorder = recorder; this.repository = repository; this.domainFactory = domainFactory; this.containerName = typeof(TDto).GetEntityNameSafe(); }
public DomainEventNotificationProducer(IRecorder recorder, IChangeEventMigrator migrator, params IDomainEventPublisherSubscriberPair[] pubSubPairs) { recorder.GuardAgainstNull(nameof(recorder)); pubSubPairs.GuardAgainstNull(nameof(pubSubPairs)); migrator.GuardAgainstNull(nameof(migrator)); this.recorder = recorder; this.pubSubPairs = pubSubPairs; this.migrator = migrator; }
public CarsApplication(IRecorder recorder, IIdentifierFactory idFactory, ICarStorage storage, IPersonsService personsService) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); storage.GuardAgainstNull(nameof(storage)); personsService.GuardAgainstNull(nameof(personsService)); this.recorder = recorder; this.idFactory = idFactory; this.storage = storage; this.personsService = personsService; }
public ReadModelCheckpointStore(IRecorder recorder, IIdentifierFactory idFactory, IDomainFactory domainFactory, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); this.recorder = recorder; this.idFactory = idFactory; this.repository = repository; this.domainFactory = domainFactory; }
public PersonsApplication(IRecorder recorder, IIdentifierFactory idFactory, IPersonStorage storage, IEmailService emailService) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); storage.GuardAgainstNull(nameof(storage)); emailService.GuardAgainstNull(nameof(emailService)); this.recorder = recorder; this.idFactory = idFactory; this.storage = storage; this.emailService = emailService; }
public GeneralEventStreamStorage(IRecorder recorder, IDomainFactory domainFactory, IChangeEventMigrator migrator, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); migrator.GuardAgainstNull(nameof(migrator)); this.recorder = recorder; this.repository = repository; this.domainFactory = domainFactory; this.migrator = migrator; this.containerName = typeof(TAggregateRoot).GetEntityNameSafe(); }
public static AzureCosmosSqlApiRepository FromSettings(IRecorder recorder, IAppSettings settings, string databaseName) { settings.GuardAgainstNull(nameof(settings)); recorder.GuardAgainstNull(nameof(recorder)); databaseName.GuardAgainstNullOrEmpty(nameof(databaseName)); var accountKey = settings.GetString("Storage:AzureCosmosDbAccountKey"); var hostName = settings.GetString("Storage:AzureCosmosDbHostName"); var localEmulatorConnectionString = $"AccountEndpoint=https://{hostName}:8081/;AccountKey={accountKey}"; return(new AzureCosmosSqlApiRepository(recorder, localEmulatorConnectionString, databaseName)); }
public CarStorage(IRecorder recorder, IDomainFactory domainFactory, IEventStreamStorage <CarEntity> eventStreamStorage, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); domainFactory.GuardAgainstNull(nameof(domainFactory)); eventStreamStorage.GuardAgainstNull(nameof(eventStreamStorage)); repository.GuardAgainstNull(nameof(repository)); this.carQueryStorage = new GeneralQueryStorage <Car>(recorder, domainFactory, repository); this.carEventStreamStorage = eventStreamStorage; this.unavailabilitiesQueryStorage = new GeneralQueryStorage <Unavailability>(recorder, domainFactory, repository); }
public ReadModelProjector(IRecorder recorder, IReadModelCheckpointStore checkpointStore, IChangeEventMigrator migrator, params IReadModelProjection[] projections) { recorder.GuardAgainstNull(nameof(recorder)); checkpointStore.GuardAgainstNull(nameof(checkpointStore)); projections.GuardAgainstNull(nameof(projections)); migrator.GuardAgainstNull(nameof(migrator)); this.recorder = recorder; this.checkpointStore = checkpointStore; this.projections = projections; this.migrator = migrator; }
protected EntityBase(IRecorder recorder, IIdentifierFactory idFactory) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); Recorder = recorder; IdFactory = idFactory; Id = idFactory.Create(this); var now = DateTime.UtcNow; LastPersistedAtUtc = null; IsDeleted = null; CreatedAtUtc = now; LastModifiedAtUtc = now; }
public InProcessReadModelProjectionSubscription(IRecorder recorder, IIdentifierFactory idFactory, IChangeEventMigrator migrator, IDomainFactory domainFactory, IRepository repository, IEnumerable <IReadModelProjection> projections, params IEventNotifyingStorage[] eventingStorages) : base(recorder, eventingStorages) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); migrator.GuardAgainstNull(nameof(migrator)); domainFactory.GuardAgainstNull(nameof(domainFactory)); repository.GuardAgainstNull(nameof(repository)); projections.GuardAgainstNull(nameof(projections)); var checkpointReadModel = new ReadModelCheckpointStore(recorder, idFactory, domainFactory, repository); this.projector = new ReadModelProjector(recorder, checkpointReadModel, migrator, projections?.ToArray()); }
private PersistableEntityBase(IRecorder recorder, IIdentifierFactory idFactory, Identifier identifier) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); identifier.GuardAgainstNull(nameof(identifier)); Recorder = recorder; IdFactory = idFactory; Id = identifier; var isInstantiating = identifier == Identifier.Empty(); var now = DateTime.UtcNow; LastPersistedAtUtc = null; CreatedAtUtc = isInstantiating ? now : DateTime.MinValue; LastModifiedAtUtc = isInstantiating ? now : DateTime.MinValue; }
/// <summary> /// Creates a new instance of the aggregate with the specified <see cref="Identifier" />, /// used during persistence instantiation. Does not raise any create event. /// </summary> protected AggregateRootBase(IRecorder recorder, IIdentifierFactory idFactory, Identifier identifier) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); identifier.GuardAgainstNull(nameof(identifier)); Recorder = recorder; IdFactory = idFactory; Id = identifier; this.events = new List <IChangeEvent>(); this.isInstantiating = identifier == Identifier.Empty(); var now = DateTime.UtcNow; LastPersistedAtUtc = null; IsDeleted = null; CreatedAtUtc = this.isInstantiating ? now : DateTime.MinValue; LastModifiedAtUtc = this.isInstantiating ? now : DateTime.MinValue; ChangeVersion = 0; }