示例#1
0
 public MongoSet(MongoContext context, String name)
 {
     Context           = context;
     Database          = context.Database;
     CollectionGeneric = Database.GetCollection <T>(name);
     //Queryable = CollectionGeneric.AsQueryable();
     Query  = InterceptingProvider.Intercept(this.CollectionGeneric.AsQueryable(), this.Context);
     Loaded = new List <T>();
 }
 public InterceptedQuery(
     InterceptingProvider provider,
     Expression expression,
     MongoContext context)
 {
     this._provider   = provider;
     this._expression = expression;
     this._context    = context;
 }
示例#3
0
        private static IQueryable <T> Intercept <T>(
            IQueryable <T> underlyingQuery,
            MongoContext context,
            params Func <Expression, Expression>[] visitors)
        {
            InterceptingProvider provider = new InterceptingProvider(
                underlyingQuery.Provider,
                context,
                visitors
                );

            return(provider.CreateQuery <T>(
                       underlyingQuery.Expression));
        }