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
hostIHostThe host whose services are used to resolve the MongoDB.Driver.IMongoDatabase instance.
Returns
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
hostBuilderIHostBuilderThe host builder to extend with the MongoDB configuration.
Returns
- IHostBuilder
The same IHostBuilder instance, allowing further fluent configuration.