コード例 #1
0
 public void ConfigureSourceProcessingStrategy(QuerySourceProcessingStrategyBuilder builder)
 {
     if (AllStreams)
     {
         builder.FromAll();
     }
     else
     {
         if (Streams != null)
         {
             foreach (var stream in Streams)
             {
                 builder.FromStream(stream);
             }
         }
         if (Categories != null)
         {
             foreach (var category in Categories)
             {
                 builder.FromCategory(category);
             }
         }
     }
     if (AllEvents)
     {
         builder.AllEvents();
     }
     else if (Events != null)
     {
         foreach (var @event in Events)
         {
             builder.IncludeEvent(@event);
         }
     }
     if (ByStreams)
     {
         builder.SetByStream();
     }
     if (ByCustomPartitions)
     {
         builder.SetByCustomPartitions();
     }
     if (Options != null)
     {
         if (Options.IncludeLinks)
         {
             builder.SetIncludeLinks();
         }
         if (!String.IsNullOrWhiteSpace(Options.ResultStreamName))
         {
             builder.SetResultStreamNameOption(Options.ResultStreamName);
         }
         if (!String.IsNullOrWhiteSpace(Options.PartitionResultStreamNamePattern))
         {
             builder.SetPartitionResultStreamNamePatternOption(Options.PartitionResultStreamNamePattern);
         }
         if (!String.IsNullOrWhiteSpace(Options.ForceProjectionName))
         {
             builder.SetForceProjectionName(Options.ForceProjectionName);
         }
         if (Options.ReorderEvents)
         {
             builder.SetReorderEvents(true);
         }
         if (Options.ProcessingLag != null)
         {
             builder.SetProcessingLag(Options.ProcessingLag.GetValueOrDefault());
         }
     }
     if (DefinesStateTransform)
     {
         builder.SetDefinesStateTransform();
     }
 }