Пример #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);
        }
Пример #2
0
 public static ElasticPagingOptions WithSnapshotLifetime(this ElasticPagingOptions options, TimeSpan lifetime)
 {
     options.UseSnapshotPaging = true;
     options.SnapshotLifetime  = lifetime;
     return(options);
 }
Пример #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);
 }
Пример #4
0
 public static ElasticPagingOptions WithScrollId(this ElasticPagingOptions options, string scrollId)
 {
     options.UseSnapshotPaging = true;
     options.ScrollId          = scrollId;
     return(options);
 }
Пример #5
0
 public static ElasticPagingOptions UseSnapshotPaging(this ElasticPagingOptions options, bool useSnapshotPaging = true)
 {
     options.UseSnapshotPaging = useSnapshotPaging;
     return(options);
 }
Пример #6
0
 public static ElasticPagingOptions WithPage(this ElasticPagingOptions options, int?page)
 {
     options.Page = page;
     return(options);
 }
Пример #7
0
 public static ElasticPagingOptions WithLimit(this ElasticPagingOptions options, int?limit)
 {
     options.Limit = limit;
     return(options);
 }