예제 #1
0
 /// <inheritdoc />
 public virtual IOrderedAggregateFluent <TResult> ThenBy(SortDefinition <TResult> newSort)
 {
     throw new NotImplementedException();
 }
 public override IAggregateFluent <TResult> Sort(SortDefinition <TResult> sort)
 {
     return(WithPipeline(_pipeline.Sort(sort)));
 }
예제 #3
0
 public override IFindFluent <TDocument, TProjection> Sort(SortDefinition <TDocument> sort)
 {
     _options.Sort = sort;
     return(this);
 }
예제 #4
0
 /// <inheritdoc />
 public abstract IAggregateFluent <TResult> Sort(SortDefinition <TResult> sort);
예제 #5
0
 public static Task <IPagedResult <TR> > GetPagedListAsync <T, TK, TR>(this IMongoCollection <T> instance, SimplePagedRequest request, FilterDefinition <T> filters, Func <T, TR> transform, SortDefinition <T> sort = null, CancellationToken cancellation = default)
     where T : DocumentBase <TK>
 {
     return(instance.ToPagedResultAsync <T, TK, TR>(filters, request, transform, sort, cancellationToken: cancellation));
 }
예제 #6
0
 /// <inheritdoc />
 public abstract IFindFluent <TDocument, TProjection> Sort(SortDefinition <TDocument> sort);
        /// <summary>
        /// Combines an existing sort with an descending field.
        /// </summary>
        /// <typeparam name="TDocument">The type of the document.</typeparam>
        /// <param name="sort">The sort.</param>
        /// <param name="field">The field.</param>
        /// <returns>
        /// A combined sort.
        /// </returns>
        public static SortDefinition <TDocument> Descending <TDocument>(this SortDefinition <TDocument> sort, Expression <Func <TDocument, object> > field)
        {
            var builder = Builders <TDocument> .Sort;

            return(builder.Combine(sort, builder.Descending(field)));
        }
        /// <summary>
        /// Combines an existing sort with an descending field.
        /// </summary>
        /// <typeparam name="TDocument">The type of the document.</typeparam>
        /// <param name="sort">The sort.</param>
        /// <param name="field">The field.</param>
        /// <returns>
        /// A combined sort.
        /// </returns>
        public static SortDefinition <TDocument> Descending <TDocument>(this SortDefinition <TDocument> sort, FieldDefinition <TDocument> field)
        {
            var builder = Builders <TDocument> .Sort;

            return(builder.Combine(sort, builder.Descending(field)));
        }
        /// <summary>
        /// Combines an existing sort with a descending sort on the computed relevance score of a text search.
        /// The field name should be the name of the projected relevance score field.
        /// </summary>
        /// <typeparam name="TDocument">The type of the document.</typeparam>
        /// <param name="sort">The sort.</param>
        /// <param name="field">The field.</param>
        /// <returns>
        /// A combined sort.
        /// </returns>
        public static SortDefinition <TDocument> MetaTextScore <TDocument>(this SortDefinition <TDocument> sort, string field)
        {
            var builder = Builders <TDocument> .Sort;

            return(builder.Combine(sort, builder.MetaTextScore(field)));
        }