Update README.md

This commit is contained in:
Alexandre SPIESER
2017-10-29 18:26:13 +00:00
committed by GitHub
parent 91277203fd
commit e561777658
+10 -10
View File
@@ -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.
``` ```