From 11952065c51723ddd26aa3cc6b8bcfb53214c5ac Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 22 Oct 2017 01:26:41 +0100 Subject: [PATCH 1/5] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 528ba31..7897a74 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@ # AspNetCore.Identity.MongoDbCore + A MongoDb UserStore and RoleStore adapter for Microsoft.AspNetCore.Identity 2.0. Allows you to use MongoDb instead of SQL server with Microsoft.AspNetCore.Identity 2.0. Covered by 737 integration tests and unit tests from the modified [Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test](https://github.com/aspnet/Identity/tree/b865d5878623077eeb715e600d75fa9c24dbb5a1/test/Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test) test suite. +Supports both `netstandard2.0` and `netcoreapp2.0`. + +Available as a Nuget package : https://www.nuget.org/packages/AspNetCore.Identity.MongoDbCore/ + + `Install-Package AspNetCore.Identity.MongoDbCore -Version 1.0.4` + # Usage examples Your user and role entities must inherit from MongoIdentityUser and MongoIdentityRole in a way similar to the IdentityUser and the IdentityRole in Microsoft.AspNetCore.Identity. From f6fb2d570e3b2d12b260e0efeb9a7d869fb8e736 Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 22 Oct 2017 01:28:32 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7897a74..230c2bb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Available as a Nuget package : https://www.nuget.org/packages/AspNetCore.Identit # Usage examples -Your user and role entities must inherit from MongoIdentityUser and MongoIdentityRole in a way similar to the IdentityUser and the IdentityRole in Microsoft.AspNetCore.Identity. +Your user and role entities must inherit from `MongoIdentityUser` and `MongoIdentityRole` in a way similar to the `IdentityUser` and the `IdentityRole` in `Microsoft.AspNetCore.Identity`, where `TKey` is the type of the primary key of your document. + Here is an example: ```csharp From 58d57506649dca0c389039df8e4753fabd66571a Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 22 Oct 2017 01:30:06 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 230c2bb..992117c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Supports both `netstandard2.0` and `netcoreapp2.0`. Available as a Nuget package : https://www.nuget.org/packages/AspNetCore.Identity.MongoDbCore/ - `Install-Package AspNetCore.Identity.MongoDbCore -Version 1.0.4` + `Install-Package AspNetCore.Identity.MongoDbCore` # Usage examples From 3e959936f8c7a08e148563ba442d44f3ce7a4634 Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 22 Oct 2017 01:40:37 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 992117c..2de7307 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Supports both `netstandard2.0` and `netcoreapp2.0`. Available as a Nuget package : https://www.nuget.org/packages/AspNetCore.Identity.MongoDbCore/ - `Install-Package AspNetCore.Identity.MongoDbCore` + Install-Package AspNetCore.Identity.MongoDbCore # Usage examples @@ -93,6 +93,10 @@ The MongoDb connection is managed using the [mongodb-generic-repository](https:/ services.ConfigureMongoDbIdentity(mongoDbIdentityConfiguration); } ``` +# Running the tests + +To run the tests, you need a local MongoDb server in default configuration (listening to `localhost:27017`). +Create a database named MongoDbTests for the tests to run. ## Author **Alexandre Spieser** From 66eaaf2dd9821a994a9e95cffd12258e7c2b21be Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 22 Oct 2017 01:53:24 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2de7307..eb26086 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Here is an example: } } ``` -The `Id` field is automatically set at instanciation, this also applies to users inheriting from `MongoIdentityUser`, where a random integer is assigned to the `Id`. It is however not advised to rely on such random mechanism to set the primary key of your document. Using documents inheriting from `MongoIdentityRole` is recommended. +The `Id` field is automatically set at instanciation, this also applies to users inheriting from `MongoIdentityUser`, where a random integer is assigned to the `Id`. It is however not advised to rely on such random mechanism to set the primary key of your document. Using documents inheriting from `MongoIdentityRole` and `MongoIdentityUser` is recommended. The configuration is done by populating a `MongoDbIdentityConfiguration` object, which can have an `IdentityOptionsAction` property set to an action you want to perform against the `IdentityOptions` (`Action`).