You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
API/src/Entities/AthleteEntity.cs

90 lines
2.9 KiB

//-----------------------------------------------------------------------
// 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
{
/// <summary>
/// Represents an athlete entity in the database.
/// </summary>
[Table("Athlete")]
public class AthleteEntity
{
/// <summary>
/// Gets or sets the unique identifier of the athlete.
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdAthlete { get; set; }
/// <summary>
/// Gets or sets the username of the athlete.
/// </summary>
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Username is required")]
public required string Username { get; set; }
/// <summary>
/// Gets or sets the last name of the athlete.
/// </summary>
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Last Name is required")]
public required string LastName { get; set; }
/// <summary>
/// Gets or sets the first name of the athlete.
/// </summary>
[MaxLength(150)]
[Required(ErrorMessage = "Athlete First Name is required")]
public required string FirstName { get; set; }
/// <summary>
/// Gets or sets the email of the athlete.
/// </summary>
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Email is required")]
public required string Email { get; set; }
/// <summary>
/// Gets or sets the gender of the athlete.
/// </summary>
[MaxLength(1)]
[Required(ErrorMessage = "Athlete Sexe is required")]
public required string Sexe { get; set; }
/// <summary>
/// Gets or sets the height of the athlete.
/// </summary>
public double Length { get; set; }
/// <summary>
/// Gets or sets the weight of the athlete.
/// </summary>
public float Weight { get; set; }
/// <summary>
/// Gets or sets the password of the athlete.
/// </summary>
[Required(ErrorMessage = "Athlete Password is required")]
public required string Password { get; set; }
/// <summary>
/// Gets or sets the date of birth of the athlete.
/// </summary>
[Required(ErrorMessage = "Athlete Date of Birth is required")]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateOnly DateOfBirth { get; set; }
/// <summary>
/// Gets or sets whether the athlete is a coach.
/// </summary>
public bool IsCoach { get; set; }
}
}