Create models and Clean Arch boilerplate
This commit is contained in:
parent
3926db5446
commit
872dc1e263
21 changed files with 576 additions and 27 deletions
33
CSR.Domain/Entities/Role.cs
Normal file
33
CSR.Domain/Entities/Role.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
namespace CSR.Domain.Entities;
|
||||
|
||||
public record Role
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
private Role(int id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
internal static Role LoadExisting(int id, string name)
|
||||
{
|
||||
return new Role(id, name);
|
||||
}
|
||||
|
||||
public static Role Admin
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Role(1, "Admin");
|
||||
}
|
||||
}
|
||||
public static Role User
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Role(2, "User");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue