Ejemplo n.º 1
0
 public static Task <T> FirstAsync <T>(this IGremlinQuery <T> query, ITypedGremlinQueryProvider provider, CancellationToken ct = default(CancellationToken))
 {
     return(query
            .Limit(1)
            .Execute(provider)
            .First(ct));
 }
Ejemplo n.º 2
0
        public static async Task <Option <T> > FirstOrNoneAsync <T>(this IGremlinQuery <T> query, ITypedGremlinQueryProvider provider, CancellationToken ct = default(CancellationToken))
        {
            var array = await query
                        .Limit(1)
                        .Execute(provider)
                        .ToArray(ct)
                        .ConfigureAwait(false);

            return(array.Length > 0
                ? array[0]
                : Option <T> .None);
        }
Ejemplo n.º 3
0
 internal static IGremlinQuery <T> ReplaceProvider <T>(this IGremlinQuery <T> query, ITypedGremlinQueryProvider provider)
 {
     return(new GremlinQueryImpl <T>(query.TraversalSourceName, query.Steps, query.StepLabelMappings, query.IdentifierFactory));
 }
Ejemplo n.º 4
0
 public static Task <T[]> ToArrayAsync <T>(this IGremlinQuery <T> query, ITypedGremlinQueryProvider provider, CancellationToken ct = default(CancellationToken))
 {
     return(query
            .Execute(provider)
            .ToArray(ct));
 }
 public static IAsyncEnumerable <TElement> Execute <TElement>(this IGremlinQuery <TElement> query, ITypedGremlinQueryProvider provider)
 {
     return(provider.Execute(query));
 }
Ejemplo n.º 6
0
 internal static IGremlinQuery <TElement> ReplaceProvider <TElement>(this IGremlinQuery <TElement> query, ITypedGremlinQueryProvider provider)
 {
     return(new GremlinQuery <TElement> .GremlinQueryImpl <Unit, Unit>(query.Steps, query.StepLabelMappings));
 }