Table of Contents

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

services IServiceCollection

The service collection.

databaseName string

The name of the database.

Exceptions

ArgumentNullException

services is null, or databaseName is null.

ArgumentException

databaseName is 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

collectionName string

The name of the collection.

Returns

WithType

An object to declare the entity types stored in the collection.

Exceptions

ArgumentNullException

collectionName is null, empty or white space.