summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
Diffstat (limited to 'Models')
-rw-r--r--Models/Group.cs2
-rw-r--r--Models/GroupUserAccount.cs8
-rw-r--r--Models/UserAccount.cs6
3 files changed, 9 insertions, 7 deletions
diff --git a/Models/Group.cs b/Models/Group.cs
index f5ed59d..31948fa 100644
--- a/Models/Group.cs
+++ b/Models/Group.cs
@@ -7,6 +7,6 @@ namespace LibraryAPI.Models {
public ICollection<GroupUserAccount>? Users { get; set; }
[Required]
[Name]
- public string? Name {get; set; }
+ public string? Name { get; set; }
}
}
diff --git a/Models/GroupUserAccount.cs b/Models/GroupUserAccount.cs
index 706c2e9..40fd359 100644
--- a/Models/GroupUserAccount.cs
+++ b/Models/GroupUserAccount.cs
@@ -2,9 +2,11 @@ using System.ComponentModel.DataAnnotations;
namespace LibraryAPI.Models {
public class GroupUserAccount {
- public long GroupId { get; set; }
- public Group? Group { get; set; }
+ [Required]
+ public long GroupId { get; set; }
+ public Group Group { get; set; }
+ [Required]
public long UserAccountId { get; set; }
- public UserAccount? UserAccount { get; set; }
+ public UserAccount UserAccount { get; set; }
}
}
diff --git a/Models/UserAccount.cs b/Models/UserAccount.cs
index e3184ed..d96a8cb 100644
--- a/Models/UserAccount.cs
+++ b/Models/UserAccount.cs
@@ -6,11 +6,11 @@ namespace LibraryAPI.Models {
public long Id { get; set; }
[Required]
public string? Email { get; set; }
- private string? _password;
- [Required]
+ private string? _password;
+ [Required]
public string? Password { get { return _password; } set { _password = HashPassword(value); } }
public ICollection<GroupUserAccount>? Groups { get; set; }
- private PasswordHasher<UserAccount> _hasher;
+ private PasswordHasher<UserAccount> _hasher;
public UserAccount() {
_hasher = new PasswordHasher<UserAccount>();