Class DatabaseExtensions
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
IMongoDatabaseMongoDB.Driver.IMongoDatabase to extend.
settings
MongoCollectionSettingsOptional MongoDB.Driver.MongoCollectionSettings.
Returns
- IMongoCollection<T>
The collection for your type.
Type Parameters
T
Type of collection to get.