Separated app into three layers, cleaned up leftovers
This commit is contained in:
23
Birdmap.DAL/Entities/Configurations/UserConfiguration.cs
Normal file
23
Birdmap.DAL/Entities/Configurations/UserConfiguration.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Birdmap.DAL.Entities.Configurations
|
||||
{
|
||||
public class UserConfiguration : IEntityTypeConfiguration<User>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<User> builder)
|
||||
{
|
||||
builder.Property(u => u.Name)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(u => u.PasswordHash)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(u => u.PasswordSalt)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(u => u.Role)
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
||||
}
|
18
Birdmap.DAL/Entities/User.cs
Normal file
18
Birdmap.DAL/Entities/User.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Birdmap.DAL.Entities
|
||||
{
|
||||
public enum Roles
|
||||
{
|
||||
User,
|
||||
Admin,
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public byte[] PasswordHash { get; set; }
|
||||
public byte[] PasswordSalt { get; set; }
|
||||
|
||||
public Roles Role { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user