public static Task <TResult> LoadDocumentAs <T, TResult>( this IMongoDatabase database, string id, Func <ProjectionDefinitionBuilder <T>, ProjectionDefinition <T> > projection, MongoCollectionName collectionName, CancellationToken cancellationToken = default ) where T : Document => database.GetDocumentCollection <T>(collectionName).LoadDocumentAs <T, TResult>(id, projection, cancellationToken);
public static Task <TResult> LoadDocumentAs <T, TResult>( this IMongoDatabase database, string id, Expression <Func <T, TResult> > projection, MongoCollectionName collectionName, CancellationToken cancellationToken = default ) where T : Document => database.GetDocumentCollection <T>(collectionName).LoadDocumentAs(id, projection, cancellationToken);
public static IMongoQueryable <T> AsQueryable <T>( this IMongoDatabase database, MongoCollectionName collectionName, Action <AggregateOptions> configure = null ) where T : Document { var options = new AggregateOptions(); configure?.Invoke(options); return(database.GetDocumentCollection <T>(collectionName).AsQueryable(options)); }
public static IMongoCollection <T> GetDocumentCollection <T>( this IMongoDatabase database, MongoCollectionName collectionName, MongoCollectionSettings settings ) where T : Document => database.GetCollection <T>(collectionName == null ? MongoCollectionName.For <T>() : collectionName, settings);
public static IMongoCollection <T> GetDocumentCollection <T>( this IMongoDatabase database, MongoCollectionSettings settings ) where T : Document => GetDocumentCollection <T>(database, MongoCollectionName.For <T>(), settings);
public static IMongoCollection <T> GetDocumentCollection <T>(this IMongoDatabase database, MongoCollectionName collectionName = null) where T : Document => GetDocumentCollection <T>(database, collectionName ?? MongoCollectionName.For <T>(), null);