Пример #1
0
 public MongoQueryProvider(MongoMetadata mongoMetadata, string connectionString, string collectionName, Type collectionType)
 {
     this.mongoContext     = new MongoContext(connectionString);
     this.mongoMetadata    = mongoMetadata;
     this.connectionString = connectionString;
     this.collectionName   = collectionName;
     this.collectionType   = collectionType;
 }
Пример #2
0
 public QueryExpressionVisitor(MongoCollection mongoCollection, MongoMetadata mongoMetadata, Type queryDocumentType)
 {
     var genericMethod = typeof(LinqExtensionMethods).GetMethods()
         .Where(x => x.Name == "AsQueryable" && x.GetParameters().Single().ParameterType.IsGenericType)
         .Single();
     var method = genericMethod.MakeGenericMethod(queryDocumentType);
     this.queryableCollection = method.Invoke(null, new object[] { mongoCollection }) as IQueryable;
     this.collectionType = queryDocumentType;
     this.mongoMetadata = mongoMetadata;
 }
Пример #3
0
        public QueryExpressionVisitor(MongoCollection mongoCollection, MongoMetadata mongoMetadata, Type queryDocumentType)
        {
            var genericMethod = typeof(LinqExtensionMethods).GetMethods()
                                .Where(x => x.Name == "AsQueryable" && x.GetParameters().Single().ParameterType.IsGenericType)
                                .Single();
            var method = genericMethod.MakeGenericMethod(queryDocumentType);

            this.queryableCollection = method.Invoke(null, new object[] { mongoCollection }) as IQueryable;
            this.collectionType      = queryDocumentType;
            this.mongoMetadata       = mongoMetadata;
        }
Пример #4
0
 public MongoQueryableResource(MongoMetadata mongoMetadata, string connectionString, string collectionName, Type collectionType)
 {
     this.mongoMetadata = mongoMetadata;
     this.provider      = new MongoQueryProvider(mongoMetadata, connectionString, collectionName, collectionType);
     this.expression    = (new DSPResource[0]).AsQueryable().Expression;
 }