Method EnsureCreated
- Namespace
- MongoDB.EntityFrameworkCore
- Assembly
- MongoDB.EntityFrameworkCore.dll
EnsureCreated(DatabaseFacade, MongoDatabaseCreationOptions)
Ensures that the database for the context exists. If it exists, no action is taken. If it does not exist then the MongoDB database is created using the MongoDatabaseCreationOptions to determine what additional actions to take.
public static bool EnsureCreated(this DatabaseFacade databaseFacade, MongoDatabaseCreationOptions options)
Parameters
databaseFacadeDatabaseFacadeThe DatabaseFacade from the EF Core DbContext.
optionsMongoDatabaseCreationOptionsAn MongoDatabaseCreationOptions object specifying additional actions to be taken.