From 70d60a229f4773fdfb9bc5dad865e1525efd0154 Mon Sep 17 00:00:00 2001 From: KerelOlivier Date: Mon, 23 May 2022 00:13:07 +0200 Subject: [PATCH 1/2] add: user model --- Models/User.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Models/User.cs diff --git a/Models/User.cs b/Models/User.cs new file mode 100644 index 0000000..57f1c31 --- /dev/null +++ b/Models/User.cs @@ -0,0 +1,15 @@ +using MongoDB.Bson; +using MongoDB.Bson.Serialization.Attributes; + +namespace backend.Models; + +public class User +{ + [BsonId] + [BsonRepresentation(BsonType.ObjectId)] + public string Id { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } //Bcrypt encrypted + public int Role { get; set; } //0 = user, 1 = author, 2 = admin +} \ No newline at end of file -- 2.30.2 From 7910bbbe2842f81f26e5743f873910267cac088e Mon Sep 17 00:00:00 2001 From: KerelOlivier Date: Tue, 24 May 2022 16:45:11 +0200 Subject: [PATCH 2/2] add: user model --- Models/User.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Models/User.cs b/Models/User.cs index 57f1c31..6e9a47b 100644 --- a/Models/User.cs +++ b/Models/User.cs @@ -10,6 +10,6 @@ public class User public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } - public string Password { get; set; } //Bcrypt encrypted - public int Role { get; set; } //0 = user, 1 = author, 2 = admin + public string Password { get; set; } //Bcrypt encrypted + public int Role { get; set; } //0 = user, 1 = author, 2 = admin } \ No newline at end of file -- 2.30.2