Example #1
0
 public ProjectionSourceDefinition Build(ProjectionNamesBuilder namingBuilder)
 {
     return(new ProjectionSourceDefinition
     {
         AllEvents = _allEvents,
         AllStreams = _allStreams,
         ByStream = _byStream,
         ByCustomPartitions = _byCustomPartitions,
         Categories = (_categories ?? new List <string>()).ToArray(),
         Events = (_events ?? new List <string>()).ToArray(),
         Streams = (_streams ?? new List <string>()).ToArray(),
         DefinesStateTransform = _definesStateTransform,
         Options = _options,
         ResultStreamName = namingBuilder.GetResultStreamName(),
         PartitionResultStreamNamePattern = namingBuilder.GetPartitionResultStreamNamePattern(),
         PartitionResultCatalogStream = namingBuilder.GetPartitionResultCatalogStreamName(),
         PartitionCatalogStream = namingBuilder.GetPartitionCatalogStreamName(),
     });
 }
 public ProjectionSourceDefinition Build(ProjectionNamesBuilder namingBuilder)
 {
     return new ProjectionSourceDefinition
         {
             AllEvents = _allEvents,
             AllStreams = _allStreams,
             ByStream = _byStream,
             ByCustomPartitions = _byCustomPartitions,
             Categories = (_categories ?? new List<string>()).ToArray(),
             Events = (_events ?? new List<string>()).ToArray(),
             Streams = (_streams ?? new List<string>()).ToArray(),
             DefinesStateTransform = _definesStateTransform,
             Options = _options,
             ResultStreamName = namingBuilder.GetResultStreamName(),
             PartitionResultStreamNamePattern = namingBuilder.GetPartitionResultStreamNamePattern(),
             PartitionResultCatalogStream = namingBuilder.GetPartitionResultCatalogStreamName(),
             PartitionCatalogStream = namingBuilder.GetPartitionCatalogStreamName(),
         };
 }
Example #3
0
        public static ProjectionSourceDefinition From(
            string name, IQuerySources sources, string handlerType, string query)
        {
            var namingBuilder = new ProjectionNamesBuilder(name, sources);

            return(new ProjectionSourceDefinition
            {
                AllEvents = sources.AllEvents,
                AllStreams = sources.AllStreams,
                ByStream = sources.ByStreams,
                ByCustomPartitions = sources.ByCustomPartitions,
                Categories = (sources.Categories ?? new string[0]).ToArray(),
                Events = (sources.Events ?? new string[0]).ToArray(),
                Streams = (sources.Streams ?? new string[0]).ToArray(),
                CatalogStream = sources.CatalogStream,
                LimitingCommitPosition = sources.LimitingCommitPosition,
                Options =
                    new QuerySourceOptions
                {
                    DefinesStateTransform = sources.DefinesStateTransform,
                    DefinesCatalogTransform = sources.DefinesCatalogTransform,
                    ProducesResults = sources.ProducesResults,
                    DefinesFold = sources.DefinesFold,
                    HandlesDeletedNotifications = sources.HandlesDeletedNotifications,
                    ForceProjectionName = sources.ForceProjectionNameOption,
                    IncludeLinks = sources.IncludeLinksOption,
                    DisableParallelism = sources.DisableParallelismOption,
                    PartitionResultStreamNamePattern = sources.PartitionResultStreamNamePatternOption,
                    ProcessingLag = sources.ProcessingLagOption.GetValueOrDefault(),
                    IsBiState = sources.IsBiState,
                    ReorderEvents = sources.ReorderEventsOption,
                    ResultStreamName = sources.ResultStreamNameOption,
                },
                ResultStreamName = namingBuilder.GetResultStreamName(),
                PartitionResultStreamNamePattern = namingBuilder.GetPartitionResultStreamNamePattern(),
                PartitionResultCatalogStream = namingBuilder.GetPartitionResultCatalogStreamName(),
                PartitionCatalogStream = namingBuilder.GetPartitionCatalogStreamName(),
                HandlerType = handlerType,
                Query = query
            });
        }
 public static ProjectionSourceDefinition From(
     string name, IQuerySources sources, string handlerType, string query)
 {
     var namingBuilder = new ProjectionNamesBuilder(name, sources);
     return new ProjectionSourceDefinition
     {
         AllEvents = sources.AllEvents,
         AllStreams = sources.AllStreams,
         ByStream = sources.ByStreams,
         ByCustomPartitions = sources.ByCustomPartitions,
         Categories = (sources.Categories ?? new string[0]).ToArray(),
         Events = (sources.Events ?? new string[0]).ToArray(),
         Streams = (sources.Streams ?? new string[0]).ToArray(),
         CatalogStream = sources.CatalogStream,
         LimitingCommitPosition = sources.LimitingCommitPosition,
         Options =
             new QuerySourceOptions
             {
                 DefinesStateTransform = sources.DefinesStateTransform,
                 ProducesResults = sources.ProducesResults,
                 DefinesFold = sources.DefinesFold,
                 ForceProjectionName = sources.ForceProjectionNameOption,
                 IncludeLinks = sources.IncludeLinksOption,
                 PartitionResultStreamNamePattern = sources.PartitionResultStreamNamePatternOption,
                 ProcessingLag = sources.ProcessingLagOption.GetValueOrDefault(),
                 ReorderEvents = sources.ReorderEventsOption,
                 ResultStreamName = sources.ResultStreamNameOption,
             },
         ResultStreamName = namingBuilder.GetResultStreamName(),
         PartitionResultStreamNamePattern = namingBuilder.GetPartitionResultStreamNamePattern(),
         PartitionResultCatalogStream = namingBuilder.GetPartitionResultCatalogStreamName(),
         PartitionCatalogStream = namingBuilder.GetPartitionCatalogStreamName(),
         HandlerType = handlerType,
         Query = query
     };
 }