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