Update README.md
This commit is contained in:
committed by
GitHub
parent
91277203fd
commit
e561777658
@@ -47,12 +47,12 @@ To add the stores, you can use the `IdentityBuilder` extension like so:
|
|||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
||||||
.AddMongoDbStores<ApplicationUser, ApplicationRole, Guid>
|
.AddMongoDbStores<ApplicationUser, ApplicationRole, Guid>
|
||||||
(
|
(
|
||||||
"mongodb://localhost:27017",
|
"mongodb://localhost:27017",
|
||||||
"MongoDbTests"
|
"MongoDbTests"
|
||||||
)
|
)
|
||||||
.AddDefaultTokenProviders();
|
.AddDefaultTokenProviders();
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to share a common `IMongoDbContext` across your services:
|
It is also possible to share a common `IMongoDbContext` across your services:
|
||||||
@@ -60,8 +60,8 @@ It is also possible to share a common `IMongoDbContext` across your services:
|
|||||||
```csharp
|
```csharp
|
||||||
var mongoDbContext = new MongoDbContext("mongodb://localhost:27017", "MongoDbTests");
|
var mongoDbContext = new MongoDbContext("mongodb://localhost:27017", "MongoDbTests");
|
||||||
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
||||||
.AddMongoDbStores<IMongoDbContext>(mongoDbContext)
|
.AddMongoDbStores<IMongoDbContext>(mongoDbContext)
|
||||||
.AddDefaultTokenProviders();
|
.AddDefaultTokenProviders();
|
||||||
// Use the mongoDbContext for other things.
|
// Use the mongoDbContext for other things.
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -70,8 +70,8 @@ You can also use the more explicit type declaration:
|
|||||||
```csharp
|
```csharp
|
||||||
var mongoDbContext = new MongoDbContext("mongodb://localhost:27017", "MongoDbTests");
|
var mongoDbContext = new MongoDbContext("mongodb://localhost:27017", "MongoDbTests");
|
||||||
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
services.AddIdentity<ApplicationUser, ApplicationRole>()
|
||||||
.AddMongoDbStores<ApplicationUser, ApplicationRole, Guid>(mongoDbContext)
|
.AddMongoDbStores<ApplicationUser, ApplicationRole, Guid>(mongoDbContext)
|
||||||
.AddDefaultTokenProviders();
|
.AddDefaultTokenProviders();
|
||||||
// Use the mongoDbContext for other things.
|
// Use the mongoDbContext for other things.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user