#4 Création de l'entité commentaire correspondant aux tests unitaires CommentaireTests

This commit is contained in:
josephine.vetu
2026-03-04 11:00:07 +01:00
parent cc8ca35539
commit c22f737867

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Webzine.Entity
{
/// <summary>
/// Classe représentant un commentaire laissé par un utilisateur sur un titre.
/// Lien avec l'entité <see cref="Titre"/> : un titre peut avoir plusieurs commentaires, mais un commentaire n'a qu'un seul titre.
/// </summary>
public class Commentaire
{
public int IdCommentaire { get; set; }
[Required]
[MinLength(10)]
[MaxLength(1000)]
[Display(Name = "Commentaire")]
public string Contenu { get; set; }
[Required]
[MinLength(2)]
[MaxLength(30)]
[Display(Name = "Nom")]
public string Auteur { get; set; }
[Required]
[Display(Name = "Date de création")]
public DateTime DateCreation { get; set; }
public int IdTitre { get; set; }
public Titre Titre { get; set; }
}
}