예제 #1
0
 public static PersistStage <TItemCache, TCache> Persist <TItemCache, TCache>(this MultiStageBase <Stream, TItemCache, TCache> stage, DirectoryInfo output, GenerationOptions generatorOptions)
     where TCache : class
     where TItemCache : class
 {
     if (stage is null)
     {
         throw new ArgumentNullException(nameof(stage));
     }
     if (output is null)
     {
         throw new ArgumentNullException(nameof(output));
     }
     if (generatorOptions is null)
     {
         throw new ArgumentNullException(nameof(generatorOptions));
     }
     return(new PersistStage <TItemCache, TCache>(stage.DoIt, output, generatorOptions, stage.Context));
 }
예제 #2
0
 public static TransformStage <TIn, TInITemCache, TInCache, TOut> Transform <TIn, TInITemCache, TInCache, TOut>(this MultiStageBase <TIn, TInITemCache, TInCache> input, Func <IDocument <TIn>, Task <IDocument <TOut> > > predicate)
     where TInCache : class
     where TInITemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     if (predicate is null)
     {
         throw new ArgumentNullException(nameof(predicate));
     }
     return(new TransformStage <TIn, TInITemCache, TInCache, TOut>(input.DoIt, predicate, input.Context));
 }
예제 #3
0
 public static SingleStage <TCheck, TPreviousItemCache, TPreviousCache> SingleEntry <TCheck, TPreviousItemCache, TPreviousCache>(this MultiStageBase <TCheck, TPreviousItemCache, TPreviousCache> input)
     where TPreviousCache : class
     where TPreviousItemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     return(new SingleStage <TCheck, TPreviousItemCache, TPreviousCache>(input.DoIt, input.Context));
 }
예제 #4
0
 public static WhereStage <TCheck, TPreviousItemCache, TPreviousCache> Where <TCheck, TPreviousItemCache, TPreviousCache>(this MultiStageBase <TCheck, TPreviousItemCache, TPreviousCache> input, Func <IDocument <TCheck>, bool> predicate)
     where TPreviousCache : class
     where TPreviousItemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     if (predicate is null)
     {
         throw new ArgumentNullException(nameof(predicate));
     }
     return(new WhereStage <TCheck, TPreviousItemCache, TPreviousCache>(input.DoIt, x => Task.FromResult(predicate(x)), input.Context));
 }
예제 #5
0
 public static SelectStage <TInput, TInputItemCache, TInputCache, TResult, TItemCache> Select <TInput, TInputItemCache, TInputCache, TResult, TItemCache>(this MultiStageBase <TInput, TInputItemCache, TInputCache> input, Func <StageBase <TInput, Stages.GeneratedHelper.CacheId <string> >, StageBase <TResult, TItemCache> > createPipline)
     where TInputCache : class
     where TInputItemCache : class
     where TItemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     return(new SelectStage <TInput, TInputItemCache, TInputCache, TResult, TItemCache>(input.DoIt, createPipline, input.Context));
 }
예제 #6
0
 public static SidecarHelper <TPreviousItemCache, TPreviousListCache> Sidecar <TPreviousItemCache, TPreviousListCache>(this MultiStageBase <Stream, TPreviousItemCache, TPreviousListCache> stage)
     where TPreviousListCache : class
     where TPreviousItemCache : class
 {
     return(new SidecarHelper <TPreviousItemCache, TPreviousListCache>(stage));
 }
예제 #7
0
 public static FileProviderStage <TInputItemCache, TInputCache> FileProvider <TInputItemCache, TInputCache>(this MultiStageBase <Stream, TInputItemCache, TInputCache> input, string providerId)
     where TInputCache : class
     where TInputItemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     if (providerId is null)
     {
         throw new ArgumentNullException(nameof(providerId));
     }
     return(new FileProviderStage <TInputItemCache, TInputCache>(providerId, input.DoIt, input.Context));
 }
예제 #8
0
 public static RazorProviderStage <TInputItemCache, TInputCache> RazorProvider <TInputItemCache, TInputCache>(this MultiStageBase <IFileProvider, TInputItemCache, TInputCache> input, string contentProviderId, string?id = null)
     where TInputCache : class
     where TInputItemCache : class
 {
     if (input is null)
     {
         throw new ArgumentNullException(nameof(input));
     }
     if (contentProviderId is null)
     {
         throw new ArgumentNullException(nameof(contentProviderId));
     }
     return(new RazorProviderStage <TInputItemCache, TInputCache>(input.DoIt, contentProviderId, id, input.Context));
 }
예제 #9
0
 public SidecarHelper(MultiStageBase <Stream, TPreviousItemCache, TPreviousListCache> stage)
 {
     this.stage = stage;
 }