Files
managing-apps/src/Managing.Infrastructure.Database/PostgreSql/Entities/UserEntity.cs
2025-11-07 23:46:48 +07:00

20 lines
727 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Managing.Infrastructure.Databases.PostgreSql.Entities;
[Table("Users")]
[Index(nameof(Name), IsUnique = true)]
public class UserEntity
{
[Key] public int Id { get; set; }
[Required] [MaxLength(255)] public required string Name { get; set; }
[MaxLength(255)] public string? AgentName { get; set; }
public string? AvatarUrl { get; set; }
public string? TelegramChannel { get; set; }
public bool IsAdmin { get; set; } = false;
// Navigation properties
public virtual ICollection<AccountEntity> Accounts { get; set; } = new List<AccountEntity>();
}