Changed roles from tables to enums
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user