From c22f737867dff2212fc743cf59fd5604bdbdff6d Mon Sep 17 00:00:00 2001 From: "josephine.vetu" Date: Wed, 4 Mar 2026 11:00:07 +0100 Subject: [PATCH] =?UTF-8?q?#4=20Cr=C3=A9ation=20de=20l'entit=C3=A9=20comme?= =?UTF-8?q?ntaire=20correspondant=20aux=20tests=20unitaires=20CommentaireT?= =?UTF-8?q?ests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Webzine.Entity/Commentaire.cs | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Webzine.Entity/Commentaire.cs diff --git a/Webzine.Entity/Commentaire.cs b/Webzine.Entity/Commentaire.cs new file mode 100644 index 0000000..36530b6 --- /dev/null +++ b/Webzine.Entity/Commentaire.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text; + +namespace Webzine.Entity +{ + /// + /// Classe représentant un commentaire laissé par un utilisateur sur un titre. + /// Lien avec l'entité : un titre peut avoir plusieurs commentaires, mais un commentaire n'a qu'un seul titre. + /// + 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; } + } +}