#4 Création de l'entité commentaire correspondant aux tests unitaires CommentaireTests
This commit is contained in:
36
Webzine.Entity/Commentaire.cs
Normal file
36
Webzine.Entity/Commentaire.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user