From 91277203fd461980dbad968372900a58c3c75573 Mon Sep 17 00:00:00 2001 From: Alexandre SPIESER Date: Sun, 29 Oct 2017 18:24:56 +0000 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7ddc3b1..e011833 100644 --- a/README.md +++ b/README.md @@ -19,27 +19,27 @@ Here is an example: ```csharp - public class ApplicationUser : MongoIdentityUser +public class ApplicationUser : MongoIdentityUser +{ + public ApplicationUser() : base() { - public ApplicationUser() : base() - { - } - - public ApplicationUser(string userName, string email) : base(userName, email) - { - } } - - public class ApplicationRole : MongoIdentityRole - { - public ApplicationRole() : base() - { - } - public ApplicationRole(string roleName) : base(roleName) - { - } - } + public ApplicationUser(string userName, string email) : base(userName, email) + { + } +} + +public class ApplicationRole : MongoIdentityRole +{ + 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`, 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.