コード例 #1
0
 public static IGraphQueryableObject <TEntity> AddConnection <TEntity, TNode>(this IGraphQueryableObject <TEntity> graphQueryable, Expression <Func <TEntity, IConnection <TNode> > > navigationFcn, int first, Action <IGraphQueryableObject <IConnection <TNode> > > connectionExpression, Action <IGraphQueryableObject <TNode> > innerGraphQueryable) where TNode : class
 {
     return(graphQueryable
            .AddObject(navigationFcn, connectionBuilder =>
     {
         connectionBuilder
         .AddObjectAs <IEnumerable <IEdge <TNode> >, IEdge <TNode> >(connection => connection.Edges, edgesBuilder => edgesBuilder
                                                                     .AddScalar(edge => edge.Cursor)
                                                                     .AddObject(edge => edge.Node, innerGraphQueryable)
                                                                     )
         .AddObject(connection => connection.PageInfo, pageInfoBuilder => pageInfoBuilder
                    .AddScalar(pageInfo => pageInfo.HasNextPage)
                    .AddScalar(pageInfo => pageInfo.HasPreviousPage)
                    )
         .AddArgument("first", first);
         connectionExpression?.Invoke(connectionBuilder);
     }));
 }
コード例 #2
0
 public PaginableResponse(IGraphQueryableObject query)
 {
     _query = query;
     _currentConnections = new Dictionary <int, IGraphQueryableObject>();
 }
コード例 #3
0
 public static IGraphQueryableObject <TEntity> AddConnection <TEntity, TNode>(this IGraphQueryableObject <TEntity> graphQueryable, Expression <Func <TEntity, IConnection <TNode> > > navigationFcn, int first, Action <IGraphQueryableObject <TNode> > innerGraphQueryable) where TNode : class
 {
     return(AddConnection(graphQueryable, navigationFcn, first, null, innerGraphQueryable));
 }