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; }
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; }
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; }
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; }