Table of Contents

Class DatabaseExtensions

Namespace
MongoDB.Driver
Assembly
Cratis.Applications.MongoDB.dll

Convenience extension methods for MongoDB.Driver.IMongoDatabase.

public static class DatabaseExtensions
Inheritance
DatabaseExtensions
Inherited Members

Methods

GetCollection<T>(IMongoDatabase, MongoCollectionSettings?)

Get a collection - with name of collection as convention (camelCase of typename).

public static IMongoCollection<T> GetCollection<T>(this IMongoDatabase database, MongoCollectionSettings? settings = null)

Parameters

database IMongoDatabase

MongoDB.Driver.IMongoDatabase to extend.

settings MongoCollectionSettings

Optional MongoDB.Driver.MongoCollectionSettings.

Returns

IMongoCollection<T>

The collection for your type.

Type Parameters

T

Type of collection to get.