Update README.md

This commit is contained in:
Alexandre SPIESER
2017-10-29 18:24:56 +00:00
committed by GitHub
parent 43b3d8efb5
commit 91277203fd
+6 -6
View File
@@ -19,8 +19,8 @@ Here is an example:
```csharp ```csharp
public class ApplicationUser : MongoIdentityUser<Guid> public class ApplicationUser : MongoIdentityUser<Guid>
{ {
public ApplicationUser() : base() public ApplicationUser() : base()
{ {
} }
@@ -28,10 +28,10 @@ Here is an example:
public ApplicationUser(string userName, string email) : base(userName, email) public ApplicationUser(string userName, string email) : base(userName, email)
{ {
} }
} }
public class ApplicationRole : MongoIdentityRole<Guid> public class ApplicationRole : MongoIdentityRole<Guid>
{ {
public ApplicationRole() : base() public ApplicationRole() : base()
{ {
} }
@@ -39,7 +39,7 @@ Here is an example:
public ApplicationRole(string roleName) : base(roleName) public ApplicationRole(string roleName) : base(roleName)
{ {
} }
} }
``` ```
The `Id` field is automatically set at instantiation, this also applies to users inheriting from `MongoIdentityUser<int>`, 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 `Id` field is automatically set at instantiation, this also applies to users inheriting from `MongoIdentityUser<int>`, 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.