mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2026-03-23 09:43:26 +08:00
Update the documentation pages
This commit is contained in:
@@ -81,7 +81,17 @@
|
||||
// that accepts a connection string or an instance of MongoClientSettings.
|
||||
options.UseMongoDb()
|
||||
.UseDatabase(new MongoClient().GetDatabase("openiddict"));
|
||||
})
|
||||
});
|
||||
</code></pre><p>Alternatively, you can register the <code>IMongoDatabase</code> instance as a service:</p>
|
||||
<pre><code class="lang-csharp">services.AddOpenIddict()
|
||||
.AddCore(options =>
|
||||
{
|
||||
options.UseMongoDb();
|
||||
});
|
||||
|
||||
// Note: to use a remote server, call the MongoClient constructor overload
|
||||
// that accepts a connection string or an instance of MongoClientSettings.
|
||||
services.AddSingleton(new MongoClient().GetDatabase("shared-database-instance"));
|
||||
</code></pre></li>
|
||||
<li><p><strong>Create indexes to improve performance</strong> (recommended): for that, you can use the following script to
|
||||
initialize the database and create the indexes used by the OpenIddict entities:</p>
|
||||
|
||||
Reference in New Issue
Block a user