Class DbContextBuilder
- Namespace
- Arc4u.MongoDB.Configuration
- Assembly
- Arc4u.MongoDB.dll
Builder used by OnConfiguring(DbContextBuilder) to map entity types to collections.
public class DbContextBuilder
- Inheritance
-
DbContextBuilder
- Inherited Members
Constructors
DbContextBuilder(IServiceCollection, string)
Creates a builder for a database.
public DbContextBuilder(IServiceCollection services, string databaseName)
Parameters
servicesIServiceCollectionThe service collection.
databaseNamestringThe name of the database.
Exceptions
- ArgumentNullException
- ArgumentException
databaseNameis empty or white space.
Methods
MapCollection(string)
Starts the mapping of a collection; follow it with With<TEntity>() to say which entity type it holds.
public WithType MapCollection(string collectionName)
Parameters
collectionNamestringThe name of the collection.
Returns
- WithType
An object to declare the entity types stored in the collection.
Exceptions
- ArgumentNullException
collectionNameis null, empty or white space.