Table of Contents

Class MongoDbHostBuilderExtension

Namespace
adas_core.Infrastructure.Utils
Assembly
adas-core.Infrastructure.dll

Provides extension methods for configuring MongoDB integration on a host builder.

public static class MongoDbHostBuilderExtension
Inheritance
MongoDbHostBuilderExtension
Inherited Members

Methods

ConfigureMongoDbConventions()

Registers global MongoDB serialization conventions, including ignoring extra elements in BSON documents and using camelCase for element names, applied to all types in the application.

public static void ConfigureMongoDbConventions()

ConfigureRegisterMapClass()

public static void ConfigureRegisterMapClass()

RunMongoMigrations(IHost)

Runs all pending MongoDB migrations found in the migrations assembly, updating the database schema to the latest version.

public static IHost RunMongoMigrations(this IHost host)

Parameters

host IHost

The host whose services are used to resolve the MongoDB.Driver.IMongoDatabase instance.

Returns

IHost

The same IHost instance, enabling fluent chaining.

UseMongo(IHostBuilder)

Configures the host builder with the MongoDB conventions and class map registrations required for the application.

public static IHostBuilder UseMongo(this IHostBuilder hostBuilder)

Parameters

hostBuilder IHostBuilder

The host builder to extend with the MongoDB configuration.

Returns

IHostBuilder

The same IHostBuilder instance, allowing further fluent configuration.