DotBased/DotBased.AspNet.Authority/Models/Authority/AuthorityUser.cs

57 lines
1.3 KiB
C#
Raw Normal View History

using DotBased.AspNet.Authority.Attributes;
2024-12-21 15:30:17 +01:00
namespace DotBased.AspNet.Authority.Models.Authority;
public class AuthorityUser : AuthorityUser<Guid>
2024-12-21 15:30:17 +01:00
{
public AuthorityUser(string userName) : this()
{
UserName = userName;
}
2024-12-21 15:30:17 +01:00
public AuthorityUser()
{
Id = Guid.NewGuid();
CreatedDate = DateTime.Now;
}
}
2024-12-26 20:01:57 +01:00
public abstract class AuthorityUser<TKey> : AuthorityUserBase where TKey : IEquatable<TKey>
{
public TKey Id { get; set; }
2024-12-26 20:01:57 +01:00
}
public abstract class AuthorityUserBase
{
public bool Enabled { get; set; }
2024-12-23 00:59:13 +01:00
public bool Confirmed { get; set; }
public bool Locked { get; set; }
public DateTime LockedDate { get; set; }
public string? UserName { get; set; }
public string? PasswordHash { get; set; }
public DateTime CreatedDate { get; set; }
public bool TwoFactorEnabled { get; set; }
public long Version { get; set; }
public long SecurityVersion { get; set; }
[Protect]
public string? EmailAddress { get; set; }
public bool EmailConfirmed { get; set; }
[Protect]
public string? PhoneNumber { get; set; }
public bool PhoneNumberConfirmed { get; set; }
public override string ToString() => UserName ?? EmailAddress ?? string.Empty;
2024-12-21 15:30:17 +01:00
}