using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using Infrastructure.Base; namespace Infrastructure.Entities; public class User : EntityBase { [Required] [MaxLength(100)] // Id is a field with a maximum length of 100 characters public string Id { get; set; } [Required] [MaxLength(200)] // Title is a required field with a maximum length of 200 characters public string FirstName { get; set; } [MaxLength(100)] // Author is a field with a maximum length of 100 characters public string LastName { get; set; } public int Age { get; set; } [MinLength(10)] // Password is a field with a minimum length of 10 characters public string Password { get; set; } public int Height { get; set; } public int Weight { get; set; } public int Sexe { get; set; } public string? WebSite { get; set; } public ICollection Experiences { get; set; } = new Collection(); public ICollection Formations { get; set; } = new Collection(); public ICollection Events { get; set; } = new Collection(); public override string ToString() { return $"\t------------Alumni Id : {Id} ------------- :" + $"\n\tFirstname : {FirstName} Lastname : {LastName} Email : {Email} Role : {Role}\n\t" + $"Experiences : {Experiences.Count} \t" + $"Formations : {Formations.Count} \t Events : {Events.Count}"; } }