Fauna v10 .NET/C# Driver 0.2.0-beta
 
Loading...
Searching...
No Matches
Pipeline.cs
Go to the documentation of this file.
1using 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 ISerializer? ElemSerializer,
20 LambdaExpression? ProjectExpr)
21{
22 public IPipelineExecutor GetExec(DataContext ctx)
23 {
24 var ser = ElemSerializer ??
25 (ElemNullable ?
26 Serializer.GenerateNullable(ctx.MappingCtx, ElemType) :
27 Serializer.Generate(ctx.MappingCtx, ElemType));
28
29 var proj = ProjectExpr?.Compile();
30
31 return IPipelineExecutor.Create(ctx, Query, ser, proj, Mode);
32 }
33}
Represents the abstract base class for constructing FQL queries.
Definition Query.cs:11