summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-06 17:04:29 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-06 17:04:29 -0600
commit8b40d27710e532a43aaf1eb198be64af1a2e576e (patch)
treecd2264d249e7cb4d1a9e3407d36d0db9680ef913 /Models
parent08819c6738a4f82ccf07ae5ed60835b087f7bb34 (diff)
Añadidos DTOs y AutomapperHEADmain
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>();