コード例 #1
0
        /// <summary>
        /// Finds matching GridFS files.
        /// </summary>
        /// <param name="query">A query.</param>
        /// <returns>The matching GridFS files.</returns>
        public MongoCursor <MongoGridFSFileInfo> Find(IMongoQuery query)
        {
            var serializationOptions = new MongoGridFSFileInfo.SerializationOptions {
                GridFS = this
            };

            return(_files.FindAs <MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions));
        }
コード例 #2
0
 /// <summary>
 /// Finds matching GridFS files.
 /// </summary>
 /// <param name="query">A query.</param>
 /// <returns>The matching GridFS files.</returns>
 public MongoCursor <MongoGridFSFileInfo> Find(IMongoQuery query)
 {
     using (_server.RequestStart(null, _settings.ReadPreference))
     {
         var serverInstance       = _server.RequestConnection.ServerInstance;
         var database             = GetDatabase();
         var filesCollection      = GetFilesCollection(database);
         var serializationOptions = new MongoGridFSFileInfo.SerializationOptions
         {
             Server         = _server,
             ServerInstance = serverInstance,
             DatabaseName   = _databaseName,
             GridFSSettings = _settings
         };
         return(filesCollection.FindAs <MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions));
     }
 }
コード例 #3
0
 /// <summary>
 /// Finds matching GridFS files.
 /// </summary>
 /// <param name="query">A query.</param>
 /// <returns>The matching GridFS files.</returns>
 public MongoCursor<MongoGridFSFileInfo> Find(
     IMongoQuery query
 ) {
     var serializationOptions = new MongoGridFSFileInfo.SerializationOptions { GridFS = this };
     return files.FindAs<MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions);
 }
コード例 #4
0
 /// <summary>
 /// Finds matching GridFS files.
 /// </summary>
 /// <param name="query">A query.</param>
 /// <returns>The matching GridFS files.</returns>
 public MongoCursor<MongoGridFSFileInfo> Find(IMongoQuery query)
 {
     using (_server.RequestStart(null, _settings.ReadPreference))
     {
         var serverInstance = _server.RequestConnection.ServerInstance;
         var database = GetDatabase();
         var filesCollection = GetFilesCollection(database);
         var serializationOptions = new MongoGridFSFileInfo.SerializationOptions
         {
             Server = _server,
             ServerInstance = serverInstance,
             DatabaseName = _databaseName,
             GridFSSettings = _settings
         };
         return filesCollection.FindAs<MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions);
     }
 }