Tenant.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Microsoft.EntityFrameworkCore;
  2. using Quadarax.Application.QLiberace.Base.Entities.Interfaces;
  3. using Quadarax.Application.QLiberace.Common.Entities.Base;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. namespace Quadarax.Application.QLiberace.Base.Entities
  7. {
  8. [Table(Constants.Modules.Base.TblTenant,Schema = Constants.Modules.Base.Schema)]
  9. [Index("Code", Name="IDX_TENANT_CODE", IsUnique = true )]
  10. public class Tenant : QlbrcEntityTracked, IStructTenant
  11. {
  12. [MaxLength(20)]
  13. [Required(AllowEmptyStrings =false)]
  14. public string Code { get; set; } = null!;
  15. [MaxLength(200)]
  16. [Required(AllowEmptyStrings =false)]
  17. public string Name { get; set; } = null!;
  18. public DateTime? LastAccess { get; set; }
  19. [Required]
  20. public bool IsLocked { get; set; }
  21. [NotMapped]
  22. public virtual ICollection<TenantUser> Users { get; set; }
  23. public Tenant()
  24. {
  25. Users = new List<TenantUser>();
  26. }
  27. }
  28. }