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
+16 -16
View File
@@ -19,27 +19,27 @@ Here is an example:
```csharp
public class ApplicationUser : MongoIdentityUser<Guid>
public class ApplicationUser : MongoIdentityUser<Guid>
{
public ApplicationUser() : base()
{
public ApplicationUser() : base()
{
}
public ApplicationUser(string userName, string email) : base(userName, email)
{
}
}
public class ApplicationRole : MongoIdentityRole<Guid>
public ApplicationUser(string userName, string email) : base(userName, email)
{
public ApplicationRole() : base()
{
}
public ApplicationRole(string roleName) : base(roleName)
{
}
}
}
public class ApplicationRole : MongoIdentityRole<Guid>
{
public ApplicationRole() : base()
{
}
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.