//----------------------------------------------------------------------- // FILENAME: AthleteEntity.cs // PROJECT: Entities // SOLUTION: HeartTrack // DATE CREATED: 22/02/2024 // AUTHOR: Antoine PEREDERII //----------------------------------------------------------------------- using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Entities { /// /// Represents an athlete entity in the database. /// [Table("Athlete")] public class AthleteEntity { /// /// Gets or sets the unique identifier of the athlete. /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int IdAthlete { get; set; } /// /// Gets or sets the username of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Username is required")] public required string Username { get; set; } /// /// Gets or sets the last name of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Last Name is required")] public required string LastName { get; set; } /// /// Gets or sets the first name of the athlete. /// [MaxLength(150)] [Required(ErrorMessage = "Athlete First Name is required")] public required string FirstName { get; set; } /// /// Gets or sets the email of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Email is required")] public required string Email { get; set; } /// /// Gets or sets the gender of the athlete. /// [MaxLength(1)] [Required(ErrorMessage = "Athlete Sexe is required")] public required string Sexe { get; set; } /// /// Gets or sets the height of the athlete. /// public double Length { get; set; } /// /// Gets or sets the weight of the athlete. /// public float Weight { get; set; } /// /// Gets or sets the password of the athlete. /// [Required(ErrorMessage = "Athlete Password is required")] public required string Password { get; set; } /// /// Gets or sets the date of birth of the athlete. /// [Required(ErrorMessage = "Athlete Date of Birth is required")] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] public DateOnly DateOfBirth { get; set; } /// /// Gets or sets whether the athlete is a coach. /// public bool IsCoach { get; set; } } }