Merge pull request 'j1/entités_du_domaine' (#40) from j1/entités_du_domaine into dev
Reviewed-on: http://10.4.0.131/DI1-P4-E1/Webzine/pulls/40 Reviewed-by: c.bobin <clement.bobin@diiage.org>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ riderModule.iml
|
|||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
[Ll]ogs/
|
[Ll]ogs/
|
||||||
.idea/
|
.idea/
|
||||||
|
/vs/
|
||||||
|
/.vs/
|
||||||
@@ -25,4 +25,8 @@
|
|||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Webzine.Entity\Webzine.Entity.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
27
Webzine.Entity/Artiste.cs
Normal file
27
Webzine.Entity/Artiste.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text;
|
||||||
|
using System.Timers;
|
||||||
|
|
||||||
|
namespace Webzine.Entity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Classe représentant un artiste.
|
||||||
|
/// Lien avec l'entité <see cref="Titre"/> : un artiste peut avoir plusieurs titres, mais un titre n'a qu'un seul artiste.
|
||||||
|
/// </summary>
|
||||||
|
public class Artiste
|
||||||
|
{
|
||||||
|
public int IdArtiste { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MinLength(2)]
|
||||||
|
[MaxLength(50)]
|
||||||
|
[Display(Name = "Nom de l'artiste")]
|
||||||
|
public string Nom { get; set; }
|
||||||
|
|
||||||
|
public string Biographie { get; set; }
|
||||||
|
|
||||||
|
public List<Titre> Titres { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Webzine.Entity/Style.cs
Normal file
22
Webzine.Entity/Style.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Webzine.Entity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Classe représentant un style de musique.
|
||||||
|
/// </summary>
|
||||||
|
public class Style
|
||||||
|
{
|
||||||
|
public int IdStyle { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MinLength(2)]
|
||||||
|
[MaxLength(50)]
|
||||||
|
[Display(Name = "Libellé")]
|
||||||
|
public string Libelle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
67
Webzine.Entity/Titre.cs
Normal file
67
Webzine.Entity/Titre.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Webzine.Entity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Classe représentant un titre de musique.
|
||||||
|
/// Lien avec l'entité <see cref="Artiste"/> : un artiste peut avoir plusieurs titres, mais un titre n'a qu'un seul artiste.
|
||||||
|
/// Lien avec l'entité <see cref="Commentaire"/> : un titre peut avoir plusieurs commentaires, mais un commentaire n'a qu'un seul titre.
|
||||||
|
/// </summary>
|
||||||
|
public class Titre
|
||||||
|
{
|
||||||
|
public int IdTitre { get; set; }
|
||||||
|
|
||||||
|
public int IdArtiste { get; set; }
|
||||||
|
|
||||||
|
public Artiste Artiste { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MinLength(1)]
|
||||||
|
[MaxLength(200)]
|
||||||
|
[Display(Name = "Titre")]
|
||||||
|
public string Libelle { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MinLength(10)]
|
||||||
|
[MaxLength(4000)]
|
||||||
|
public string Chronique { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Display(Name = "Date de création")]
|
||||||
|
public DateTime DateCreation { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Durée en secondes")]
|
||||||
|
public int Duree { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Display(Name = "Date de sortie")]
|
||||||
|
public DateTime DateSortie { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MaxLength(250)]
|
||||||
|
[Display(Name = "Jaquette de l'album")]
|
||||||
|
public string UrlJaquette { get; set; }
|
||||||
|
|
||||||
|
[MinLength(13)]
|
||||||
|
[MaxLength(250)]
|
||||||
|
[Display(Name = "URL d'écoute")]
|
||||||
|
public string UrlEcoute { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Display(Name = "Nombre de lectures")]
|
||||||
|
public int NbLectures { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Display(Name = "Nombre de likes")]
|
||||||
|
public int NbLikes { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string Album { get; set; }
|
||||||
|
|
||||||
|
public List<Commentaire> Commentaires { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ActiveDebugProfile>https</ActiveDebugProfile>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user