Create models and Clean Arch boilerplate
This commit is contained in:
parent
3926db5446
commit
872dc1e263
21 changed files with 576 additions and 27 deletions
17
CSR.Infrastructure/Persistence/User.cs
Normal file
17
CSR.Infrastructure/Persistence/User.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
namespace CSR.Infrastructure.Persistence;
|
||||
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public required string Username { get; set; }
|
||||
public required string Email { get; set; }
|
||||
public required string PasswordHash { get; set; }
|
||||
public required int RoleId { get; set; }
|
||||
|
||||
// Navigation property
|
||||
public Role Role { get; set; } = null!;
|
||||
|
||||
// prevent direct instantiation
|
||||
// use UserService to create a new user
|
||||
internal User() { }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue