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.
51 lines
1.5 KiB
51 lines
1.5 KiB
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<ExperienceEntity> Experiences { get; set; } = new Collection<ExperienceEntity>();
|
|
|
|
public ICollection<FormationEntity> Formations { get; set; } = new Collection<FormationEntity>();
|
|
|
|
public ICollection<EventEntity> Events { get; set; } = new Collection<EventEntity>();
|
|
|
|
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}";
|
|
|
|
}
|
|
} |