54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
// <copyright file="StyleFactory.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Webzine.Entity.Fixtures
|
|
{
|
|
using Webzine.Entity;
|
|
public class StyleFactory
|
|
{
|
|
/// <summary>
|
|
/// Générer une liste de style pour seeder la base
|
|
/// de données.
|
|
/// </summary>
|
|
/// <returns>Liste de style.</returns>
|
|
public static List<Style> CreerListeStyle(int minCount = 15, int maxCount = 20)
|
|
{
|
|
List<string> libelles = new List<string>
|
|
{
|
|
"Pop",
|
|
"Rock",
|
|
"Jazz",
|
|
"Blues",
|
|
"Hip-Hop",
|
|
"Rap",
|
|
"Electro",
|
|
"Techno",
|
|
"House",
|
|
"Metal",
|
|
"Funk",
|
|
"Soul",
|
|
"R&B",
|
|
"Classique",
|
|
"Reggae",
|
|
"Punk",
|
|
"Folk",
|
|
"Disco",
|
|
"Ambient",
|
|
"Indie",
|
|
};
|
|
|
|
Random random = new Random();
|
|
int count = random.Next(minCount, maxCount + 1);
|
|
|
|
return libelles
|
|
.Take(count)
|
|
.Select(libelle => new Style
|
|
{
|
|
Libelle = libelle,
|
|
})
|
|
.ToList();
|
|
}
|
|
}
|
|
}
|