Fauna .NET Driver 0.1.0-beta
 
Loading...
Searching...
No Matches
Pipeline.cs
Go to the documentation of this file.
2using System.Linq.Expressions;
3
4namespace Fauna.Linq;
5
6public enum PipelineMode
7{
8 Query, // "pure" query. no local processing required (except deserialization)
9 Project, // elements have local projection.
10 SetLoad, // post-processing on loaded set required
11 Scalar, // final, non-enum result: no more transformations allowed
12}
13
14internal readonly record struct Pipeline(
15 PipelineMode Mode,
17 Type ElemType,
18 bool ElemNullable,
19 IDeserializer? ElemDeserializer,
20 LambdaExpression? ProjectExpr)
21{
22 public PipelineExecutor GetExec(DataContext ctx)
23 {
24 var deser = ElemDeserializer ??
25 (ElemNullable ?
26 Deserializer.GenerateNullable(ctx.MappingCtx, ElemType) :
27 Deserializer.Generate(ctx.MappingCtx, ElemType));
28
29 var proj = ProjectExpr is null ? null : ProjectExpr.Compile();
30
31 return PipelineExecutor.Create(ctx, Query, deser, proj, Mode);
32 }
33}
Represents the abstract base class for constructing FQL queries.
Definition Query.cs:11