Class MongoModelBuilder
Fluent builder for the MongoModel — one Entity call per mapped type.
public sealed class MongoModelBuilder
- Inheritance
-
MongoModelBuilder
- Inherited Members
Methods
Build()
Builds the model. The DI extensions call this for you; call it directly when hosting without DI — the built model is the introspection handle (Explain()).
public MongoModel Build()
Returns
Entity<TEntity>(Action<MongoEntityBuilder<TEntity>>)
Maps TEntity — collection name, id member, element renames, exclusions and
value conversions. Applies once per process (the driver's class maps are global and freeze on first
use), with the usual precedence: conventions < annotations < fluent.
public MongoModelBuilder Entity<TEntity>(Action<MongoEntityBuilder<TEntity>> configure) where TEntity : class
Parameters
configureAction<MongoEntityBuilder<TEntity>>The fluent configuration.
Returns
- MongoModelBuilder
The same builder for chaining.
Type Parameters
TEntityThe entity type.