Beispiel #1
0
        /// <summary>
        /// Exposes the MongoDB collection for the given entity type as IAggregateFluent in order to facilitate Fluent queries
        /// </summary>
        /// <typeparam name="T">The type of entity</typeparam>
        /// <param name="options">The options for the aggregation. This is not required.</param>
        /// <param name="ignoreGlobalFilters">Set to true if you'd like to ignore any global filters for this operation</param>
        public IAggregateFluent <T> Fluent <T>(AggregateOptions options = null, bool ignoreGlobalFilters = false) where T : IEntity
        {
            var globalFilter = Logic.MergeWithGlobalFilter(ignoreGlobalFilters, globalFilters, Builders <T> .Filter.Empty);

            if (globalFilter != Builders <T> .Filter.Empty)
            {
                return(DB
                       .Fluent <T>(options, Session)
                       .Match(globalFilter));
            }

            return(DB.Fluent <T>(options, Session));
        }
 /// <summary>
 /// An IAggregateFluent collection of sibling Entities.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="session">An optional session if using within a transaction</param>
 /// <param name="options">The options for the aggregation. This is not required.</param>
 public static IAggregateFluent <T> Fluent <T>(this T _, IClientSessionHandle session = null, AggregateOptions options = null) where T : IEntity
 {
     return(DB.Fluent <T>(options, session));
 }
 public IAggregateFluent <T> Fluent <T>(AggregateOptions options = null)
 {
     return(DB.Fluent <T>(options, Session, db));
 }
Beispiel #4
0
 /// <summary>
 /// Exposes the MongoDB collection for the given entity type as IAggregateFluent in order to facilitate Fluent queries
 /// </summary>
 /// <typeparam name="T">The type of entity</typeparam>
 /// <param name="options">The options for the aggregation. This is not required.</param>
 public virtual IAggregateFluent <T> Fluent <T>(AggregateOptions options = null) where T : IEntity
 {
     return(DB.Fluent <T>(options, session));
 }