Changed roles from tables to enums

This commit is contained in:
Dimitar Todorov
2022-03-25 16:47:49 +02:00
parent 02bb8d455c
commit 6498f358a3
19 changed files with 297 additions and 350 deletions

View File

@@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Data.Entities
{
public class Role
{
public Role()
{
this.Users = new HashSet<User>();
}
public Role(string name) : this()
{
this.Name = name;
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<User> Users { get; set; }
}
}

View File

@@ -8,6 +8,13 @@ namespace Data.Entities
{
public class User
{
public enum RoleEnum
{
User,
Manager
}
public int Id { get; set; }
public string Username { get; set; }
@@ -24,8 +31,6 @@ namespace Data.Entities
public string Email { get; set; }
public int RoleId { get; set; }
public Role Role { get; set; }
public RoleEnum Role { get; set; }
}
}