From b6c3c864e9c1f51a32857708619f30a6e8bd51cc Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Tue, 29 Jun 2021 17:30:39 +0000 Subject: [PATCH] Update the documentation pages --- configuration/mongodb-integration.html | 35 +++++++++++++++----------- manifest.json | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/configuration/mongodb-integration.html b/configuration/mongodb-integration.html index 74da94b..2630087 100644 --- a/configuration/mongodb-integration.html +++ b/configuration/mongodb-integration.html @@ -96,11 +96,13 @@ var services = new ServiceCollection(); services.AddOpenIddict() .AddCore(options => options.UseMongoDb()); -services.AddSingleton(new MongoClient("mongodb://localhost:27017").GetDatabase("openiddict")); +services.AddSingleton(new MongoClient( + "mongodb://localhost:27017").GetDatabase("openiddict")); var provider = services.BuildServiceProvider(); var context = provider.GetRequiredService<IOpenIddictMongoDbContext>(); -var options = provider.GetRequiredService<IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue; +var options = provider.GetRequiredService< + IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue; var database = await context.GetDatabaseAsync(CancellationToken.None); var applications = database.GetCollection<OpenIddictMongoDbApplication>( @@ -136,17 +138,18 @@ await applications.Indexes.CreateManyAsync(new[] var authorizations = database.GetCollection<OpenIddictMongoDbAuthorization>( options.AuthorizationsCollectionName); -await authorizations.Indexes.CreateOneAsync(new CreateIndexModel<OpenIddictMongoDbAuthorization>( - Builders<OpenIddictMongoDbAuthorization>.IndexKeys - .Ascending(authorization => authorization.ApplicationId) - .Ascending(authorization => authorization.Scopes) - .Ascending(authorization => authorization.Status) - .Ascending(authorization => authorization.Subject) - .Ascending(authorization => authorization.Type), - new CreateIndexOptions - { - Background = true - })); +await authorizations.Indexes.CreateOneAsync( + new CreateIndexModel<OpenIddictMongoDbAuthorization>( + Builders<OpenIddictMongoDbAuthorization>.IndexKeys + .Ascending(authorization => authorization.ApplicationId) + .Ascending(authorization => authorization.Scopes) + .Ascending(authorization => authorization.Status) + .Ascending(authorization => authorization.Subject) + .Ascending(authorization => authorization.Type), + new CreateIndexOptions + { + Background = true + })); var scopes = database.GetCollection<OpenIddictMongoDbScope>( options.ScopesCollectionName); @@ -164,13 +167,15 @@ var tokens = database.GetCollection<OpenIddictMongoDbToken>( await tokens.Indexes.CreateManyAsync(new[] { new CreateIndexModel<OpenIddictMongoDbToken>( - Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending(token => token.ReferenceId), + Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending( + token => token.ReferenceId), new CreateIndexOptions<OpenIddictMongoDbToken> { // Note: partial filter expressions are not supported on Azure Cosmos DB. // As a workaround, the expression and the unique constraint can be removed. PartialFilterExpression = - Builders<OpenIddictMongoDbToken>.Filter.Exists(token => token.ReferenceId), + Builders<OpenIddictMongoDbToken>.Filter.Exists( + token => token.ReferenceId), Unique = true }), diff --git a/manifest.json b/manifest.json index 3792d89..a8f2c1d 100644 --- a/manifest.json +++ b/manifest.json @@ -5661,7 +5661,7 @@ "output": { ".html": { "relative_path": "configuration/mongodb-integration.html", - "hash": "OBbgaaZ+b0E3MY4vEl7/kw==" + "hash": "za1L8HGicVtf0iDEj8PMvw==" } }, "is_incremental": false,