User.cs 964 B

12345678910111213141516171819202122232425262728293031
  1. using System.ComponentModel;
  2. using System.ComponentModel.DataAnnotations;
  3. using Quadarax.Application.QLiberace.Base.Entities.Interfaces;
  4. using Quadarax.Application.QLiberace.Common.Entities.Base;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. using Microsoft.EntityFrameworkCore;
  7. namespace Quadarax.Application.QLiberace.Base.Entities
  8. {
  9. [Table(Constants.Modules.Base.TblUser,Schema = Constants.Modules.Base.Schema)]
  10. [Index("LoginName", Name="IDX_LOGIN_NAME", IsUnique = true )]
  11. public class User : QlbrcEntityTracked, IStructUser
  12. {
  13. [MaxLength(100)]
  14. [Required(AllowEmptyStrings = false)]
  15. public string LoginName { get; set; } = null!;
  16. [Required]
  17. [DefaultValue(false)]
  18. public bool IsLocked { get; set; }
  19. [NotMapped]
  20. public virtual ICollection<TenantUser> Tenants { get; set; }
  21. public User()
  22. {
  23. Tenants = new List<TenantUser>();
  24. }
  25. }
  26. }