public async Task <IEnumerable <string> > GetAll(DateTime?effectiveDateTime = null) { _processor = new AzureBlobIdentifierGroupProcessorUntyped(_domainName, _aggregateTypeName, _connectionStringName, ConnectionStringNameAttribute.DefaultBlobStreamSettings(_domainName, _aggregateTypeName)); if (null == _processor) { // Cannot get the members anyway return(Enumerable.Empty <string>()); } else { return(await _processor.GetAll(effectiveDateTime)); } }
/// <summary> /// Create the projection from the attribute linked to the function parameter /// </summary> /// <param name="attribute"> /// The attribute describing which projection to run /// </param> public Projection(ProjectionAttribute attribute, string connectionStringName = "") { _domainName = attribute.DomainName; _aggregateTypeName = attribute.AggregateTypeName; _aggregateInstanceKey = attribute.InstanceKey; _projectionTypeName = attribute.ProjectionTypeName; if (string.IsNullOrWhiteSpace(connectionStringName)) { _connectionStringName = ConnectionStringNameAttribute.DefaultConnectionStringName(attribute); } else { _connectionStringName = connectionStringName; } if (null == _projectionProcessor) { // TODO : Allow for different backing technologies... currently just AppendBlob _projectionProcessor = CQRSAzure.EventSourcing.Azure.Blob.Untyped.BlobEventStreamReaderUntyped.CreateProjectionProcessor(attribute, ConnectionStringNameAttribute.DefaultBlobStreamSettings(_domainName, _aggregateTypeName)); } }
/// <summary> /// Classify whether the aggregate instance is inside or outside the group as determined by the classifier /// </summary> /// <param name="classifierToProcess"> /// The class containing the classifier logic to run /// </param> /// <param name="effectiveDateTime"> /// The time as-of which to ge the classificiation (or if null, get the latest possible ) /// </param> /// <param name="forceExclude"> /// If set, consider anything not classified as included to be excluded /// </param> /// <param name="projection"> /// If set and the classification depends on the result of a projection use the projection /// </param> public async Task <IClassifierDataSourceHandler.EvaluationResult> Classify(IClassifierUntyped classifierToProcess = null, DateTime?effectiveDateTime = null, bool forceExclude = false, IProjectionUntyped projection = null) { _classifierProcessor = CQRSAzure.IdentifierGroup.Azure.Blob.AzureBlobClassifierUntyped.CreateClassifierProcessor(new ClassifierAttribute(_domainName, _aggregateTypeName, _aggregateInstanceKey, _classifierTypeName), classifierToProcess, ConnectionStringNameAttribute.DefaultBlobStreamSettings(_domainName, _aggregateTypeName)); if (null != _classifierProcessor) { return(await _classifierProcessor.Classify(classifierToProcess, effectiveDateTime, forceExclude, projection)); } else { if (forceExclude) { return(IClassifierDataSourceHandler.EvaluationResult.Exclude); } else { return(IClassifierDataSourceHandler.EvaluationResult.Unchanged); } } }