public ActionPipe( Func <TInput, Task> action, IOutputPipe <TInput> parent) : base(parent) { this.action = action; }
public MappingPipe( Func <TInput, Task <TOutput> > mapping, IOutputPipe <TInput> parent) : base(parent) { this.mapping = mapping; }
public static OutputPipe <TInput> CurrentUserHas <TInput>( this IOutputPipe <TInput> pipe, Func <ClaimsPrincipal, TInput, bool> predicate, object error = null) where TInput : class => pipe.GetRequiredService <IClaimValidationPipeFactory <TInput> >() .Resolve(predicate, error, pipe);
public EntityDeletionPipe( DbContext context, IOutputPipe <TInput> parent) : base(parent) { this.context = context; }
public static OutputPipe <TInput> CurrentUserHasClaim <TInput>( this IOutputPipe <TInput> pipe, string claimType, Func <TInput, string> claim, object error = null) where TInput : class => pipe.CurrentUserHas((p, e) => p.HasClaim(claimType, claim(e)), error);
public QueryablePipe( Func <TInput, TOutput> callback, IOutputPipe <TInput> parent) : base(parent) { this.callback = callback; }
public static OutputPipe <TEntity> InvalidWhen <TEntity>( this IOutputPipe <TEntity> pipe, Func <TEntity, bool> invalidCheck, int statusCode, object error = null) where TEntity : class => pipe.InvalidWhen(e => Task.FromResult(invalidCheck(e)), statusCode, error);
public Logger(IOutputPipe stdout, IOutputPipe stderr, bool timestamp = true, bool loggingLevel = true) { this.stdout = stdout; this.stderr = stderr; this.timestamp = timestamp; this.loggingLevel = loggingLevel; }
public static OutputPipe <TInput> InvalidWhen <TInput>( this IOutputPipe <TInput> pipe, Func <bool> invalidCheck, int statusCode, object error = null) where TInput : class => pipe.InvalidWhen(() => Task.FromResult(invalidCheck()), statusCode, error);
public static OutputPipe <IQueryable <TInput> > ApplyOrderByClientRequest <TInput>( this IOutputPipe <IQueryable <TInput> > pipe, Func <IOrderByExpressionBuilder <TInput>, IOrderByExpressionBuilder <TInput> > builder) { var orderByExpressionBuilder = pipe.GetService <IOrderByExpressionBuilder <TInput> >(); return(pipe.ApplyOrderByClientRequest(builder(orderByExpressionBuilder).Build())); }
public static Task <IActionResult> ToOkResult <TInput>( this IOutputPipe <TInput> pipe) where TInput : class { IPipe resultPipe = new OkResultPipe <TInput>(pipe); return(resultPipe.Execute()); }
public Logger(IOutputPipe stdout, IOutputPipe stderr, bool timestamp = true, bool loggingLevel = true) { this.stdout = stdout; this.stderr = stderr; this.timestamp = timestamp; this.loggingLevel = loggingLevel; this.JsonSerializerSettings = new JsonSerializerSettings(); }
public OutputPipe <RestEntityCollection> Resolve( Func <TInput, TOutput> mapping, IOutputPipe <IQueryable <TInput> > parent) => new CollectionMappingPipe <TInput, TOutput>( mapping, this.linkGenerator, this.paginationMetaInfoStorage, this.queryableTransformer, parent);
public static OutputPipe <TEntity> InvalidWhen <TEntity>( this IOutputPipe <TEntity> pipe, Func <TEntity, Task <bool> > invalidCheck, int statusCode, object error = null) where TEntity : class => pipe.GetService <IEntityValidationPipeFactory <TEntity> >() .Resolve(invalidCheck, statusCode, error, pipe);
public QueryableSourcePipe( Func <IQueryableFactory, TInput, IQueryable <TOutput> > queryablePipe, IQueryableFactory queryableFactory, IOutputPipe <TInput> parent) : base(parent) { this.queryablePipe = queryablePipe; this.queryableFactory = queryableFactory; }
public ValidationPipe( Func <Task <bool> > invalidCheck, int statusCode, object error, IOutputPipe <TInput> parent) : base(statusCode, error, parent) { this.invalidCheck = invalidCheck; }
public FirstOrDefaultPipe( Expression <Func <TInput, bool> > predicate, IQueryableTransformer <TInput> queryableTransformer, IOutputPipe <IQueryable <TInput> > parent) : base(parent) { this.predicate = predicate; this.queryableTransformer = queryableTransformer; }
public EntityInsertionPipe( DbContext context, IScopedStorage <TInput> storage, IOutputPipe <TInput> parent) : base(parent) { this.context = context; this.storage = storage; }
protected ValidationPipeBase( int statusCode, object error, IOutputPipe <TInput> parent) : base(parent) { this.statusCode = statusCode; this.error = error; }
public CreatedEntityResultPipe( Func <TInput, object> routeValuesGenerator, string routeName, IOutputPipe <TInput> parent) : base(parent) { this.routeValuesGenerator = routeValuesGenerator; this.routeName = routeName; }
public CreatedEntityResultPipe( Func <IServiceProvider, object> routeValuesGenerator, string routeName, IOutputPipe <TInput> parent) : base(parent) { this.routeValuesGenerator = t => routeValuesGenerator(this); this.routeName = routeName; }
public FilterByClientRequestPipe( IDictionary <string, IFilterExpressionProvider <TInput> > filterDictionary, IFilterByClientRequestInterpreter interpreter, IOutputPipe <IQueryable <TInput> > parent) : base(parent) { this.filterDictionary = filterDictionary; this.interpreter = interpreter; }
public OutputPipe <IQueryable <TInput> > Resolve( PaginationOptions options, IOutputPipe <IQueryable <TInput> > parent) => new PaginationByClientRequestPipe <TInput>( options, this.interpreter, this.paginationMetaInfoStorage, this.queryableTransformer, parent);
public OrderByClientRequestPipe( IDictionary <string, IOrderByExpressionFactory <TInput> > orderByDictionary, IOrderByClientRequestInterpreter orderByClientRequestInterpreter, IOutputPipe <IQueryable <TInput> > parent) : base(parent) { this.orderByDictionary = orderByDictionary; this.orderByClientRequestInterpreter = orderByClientRequestInterpreter; }
public static OutputPipe <TOutput> UseMapper <TInput, TOutput>( this IOutputPipe <TInput> pipe, Func <IMapperFactory <TInput>, IMapper <TInput, TOutput> > selection) where TInput : class where TOutput : class { var mapper = pipe.GetService <IMapperFactory <TInput> >(); return(pipe.Map(i => selection(mapper).Map(i))); }
public ClaimValidationPipe( Func <ClaimsPrincipal, TInput, bool> validCheck, ClaimsPrincipal principal, object error, IOutputPipe <TInput> parent) : base(StatusCodes.Status403Forbidden, error, parent) { this.principal = principal; this.validCheck = validCheck; }
/// <summary> /// Constructor. /// </summary> /// <param name="characterReader">InputPipe to use for reading single characters.</param> public JsonRpcPipe(IInputPipe characterReader, IOutputPipe characterWriter) { this.characterReader = characterReader; this.characterWriter = characterWriter; this.blockQueue = new ConcurrentQueue <object>(); this.JsonSerializerSettings = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }; }
public static OutputPipe <TOutput> BuildMapping <TInput, TOutput>( this IOutputPipe <TInput> pipe, Func <IMappingBuilder <TInput>, Func <TInput, TOutput> > builder) where TInput : class where TOutput : class { var mappingBuilder = pipe.GetService <IMappingBuilder <TInput> >(); return(pipe.Map(builder(mappingBuilder))); }
public static OutputPipe <RestEntityCollection> UseMapperForCollection <TInput, TOutput>( this IOutputPipe <IQueryable <TInput> > pipe, Func <IMapperFactory <TInput>, IMapper <TInput, TOutput> > selection) where TInput : class where TOutput : class { var transformer = pipe.GetService <IMapperFactory <TInput> >(); return(pipe.MapToRestCollection(i => selection(transformer).Map(i))); }
public static OutputPipe <RestEntityCollection> BuildMappingForCollection <TInput, TOutput>( this IOutputPipe <IQueryable <TInput> > pipe, Func <IMappingBuilder <TInput>, Func <TInput, TOutput> > builder) where TInput : class where TOutput : class { var transformerBuilder = pipe.GetService <IMappingBuilder <TInput> >(); return(pipe.MapToRestCollection(builder(transformerBuilder))); }
/// <summary> /// Constructs the XML output pipe. /// </summary> /// <param name="outputPipe">The target output pipe which to write to.</param> public JsonOutputPipe(IOutputPipe outputPipe) { // validate arguments if (outputPipe == null) throw new ArgumentNullException("outputPipe"); // set values this.outputPipe = outputPipe; // create the reader jsonWriter = new JsonTextWriter(outputPipe.Writer) { CloseOutput = false, Formatting = Formatting.None }; }
/// <summary> /// Constructs the XML output pipe. /// </summary> /// <param name="outputPipe">The target output pipe which to write to.</param> public XmlOutputPipe(IOutputPipe outputPipe) { // validate arguments if (outputPipe == null) throw new ArgumentNullException("outputPipe"); // set values this.outputPipe = outputPipe; // create the reader xmlWriter = XmlWriter.Create(outputPipe.Writer, new XmlWriterSettings { CloseOutput = false, NamespaceHandling = NamespaceHandling.OmitDuplicates }); // create the namespace manager NamespaceManager = new XmlNamespaceManager(new NameTable()); }
/// <summary> /// Constructs the XML output pipe. /// </summary> /// <param name="outputPipe">The target output pipe which to write to.</param> /// <param name="format">The <see cref="CsvOutputFormat"/> which to use.</param> public CsvOutputPipe(IOutputPipe outputPipe, CsvOutputFormat format) { // validate arguments if (outputPipe == null) throw new ArgumentNullException("outputPipe"); if (format == null) throw new ArgumentNullException("format"); // set values this.outputPipe = outputPipe; this.format = format; // write the document start delimitor when available if (format.HasDocumentStartDelimitor) outputPipe.Writer.Write(format.DocumentStartDelimitor); // write the column headers when needed if (format.IncludeColumnHeaders) Write(format.ColumnHeaders); }