TekH 5d3f73bb13 Refactor entity properties for nullability and requirements
Removed nullable indicators from string properties in
BaseEntity.cs, ClientUser.cs, Group.cs, and User.cs.
The Username property in User.cs is now marked as
required for .NET 7 or greater, improving data integrity
and reducing null reference risks.
2025-06-26 13:20:54 +02:00

43 lines
1.1 KiB
C#

using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_GROUPS", Schema = "dbo")]
public class Group : BaseEntity
{
[StringLength(50)]
public string
#if NET7_0_OR_GREATER
?
#endif
Name { get; set; }
[Required]
[DefaultValue(false)]
[Column("AD_SYNC")]
public bool AdSync { get; set; }
[Required]
[DefaultValue(false)]
public bool Internal { get; set; }
[Required]
[DefaultValue(true)]
public bool Active { get; set; }
[StringLength(200)]
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
[Required]
[Column("ECM_FK_ID")]
[DefaultValue(-1)]
public int EcmFkId { get; set; } = -1;
}
}