Esempio n. 1
0
        public static ElasticPagingOptions FromOptions(IPagingOptions options)
        {
            var elasticOptions = new ElasticPagingOptions();

            if (options == null)
            {
                return(elasticOptions);
            }

            elasticOptions.Page  = options.Page;
            elasticOptions.Limit = options.Limit;

            return(elasticOptions);
        }
Esempio n. 2
0
 public static ElasticPagingOptions WithSnapshotLifetime(this ElasticPagingOptions options, TimeSpan lifetime)
 {
     options.UseSnapshotPaging = true;
     options.SnapshotLifetime  = lifetime;
     return(options);
 }
Esempio n. 3
0
 public static ElasticPagingOptions WithScrollId <T>(this ElasticPagingOptions options, FindResults <T> results) where T : class
 {
     options.UseSnapshotPaging = true;
     options.ScrollId          = results.GetScrollId();
     return(options);
 }
Esempio n. 4
0
 public static ElasticPagingOptions WithScrollId(this ElasticPagingOptions options, string scrollId)
 {
     options.UseSnapshotPaging = true;
     options.ScrollId          = scrollId;
     return(options);
 }
Esempio n. 5
0
 public static ElasticPagingOptions UseSnapshotPaging(this ElasticPagingOptions options, bool useSnapshotPaging = true)
 {
     options.UseSnapshotPaging = useSnapshotPaging;
     return(options);
 }
Esempio n. 6
0
 public static ElasticPagingOptions WithPage(this ElasticPagingOptions options, int?page)
 {
     options.Page = page;
     return(options);
 }
Esempio n. 7
0
 public static ElasticPagingOptions WithLimit(this ElasticPagingOptions options, int?limit)
 {
     options.Limit = limit;
     return(options);
 }