Commande dotnet format

This commit is contained in:
josephine.vetu
2026-03-28 10:09:18 +01:00
committed by b.nodon
parent 18075a9792
commit fe2a339fc1
51 changed files with 265 additions and 228 deletions

View File

@@ -16,6 +16,7 @@ public class ArtisteController : Controller
private readonly IArtisteRepository artisteRepository;
/// <summary>
/// Initializes a new instance of the <see cref="ArtisteController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="ArtisteController"/>.
/// </summary>
/// <param name="logger">Logger.</param>

View File

@@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Mvc;
using Webzine.Entity;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire;
namespace Webzine.WebApplication.Areas.Administration.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Entity;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire;
[Area("Administration")]
public class CommentaireController : Controller
{
@@ -12,6 +12,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
private readonly ICommentaireRepository commentaireRepository;
/// <summary>
/// Initializes a new instance of the <see cref="CommentaireController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="CommentaireController"/>.
/// Utilise l'injection de dépendances pour récupérer le repository.
/// </summary>
@@ -37,10 +38,10 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
// Initialisation du ViewModel
var viewModel = new CommentaireViewModel
{
Commentaires = commentaires
Commentaires = commentaires,
};
return View(viewModel);
return this.View(viewModel);
}
/// <summary>
@@ -58,10 +59,10 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
Auteur = commentaire.Auteur,
Contenu = commentaire.Contenu,
DateCreation = commentaire.DateCreation,
TitreLibelle = commentaire.Titre?.Libelle
TitreLibelle = commentaire.Titre?.Libelle,
};
return View(model);
return this.View(model);
}
/// <summary>
@@ -79,7 +80,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
this.commentaireRepository.Delete(commentaire);
}
return RedirectToAction("Index");
return this.RedirectToAction("Index");
}
}
}

View File

@@ -16,6 +16,7 @@ public class DashboardController : Controller
private readonly ITitreRepository titreRepository;
/// <summary>
/// Initializes a new instance of the <see cref="DashboardController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="DashboardController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté.</param>

View File

@@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.Areas.Administration.ViewModels.Style;
namespace Webzine.WebApplication.Areas.Administration.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.Areas.Administration.ViewModels.Style;
/// <summary>
/// Contrôleur pour la gestion des styles dans l'administration du webzine.
/// </summary>
@@ -14,6 +14,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
private readonly IStyleRepository styleRepository;
/// <summary>
/// Initializes a new instance of the <see cref="StyleController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="StyleController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté.</param>
@@ -93,7 +94,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
[HttpGet]
public IActionResult Edit(int id)
{
var style = styleRepository.Find(id);
var style = this.styleRepository.Find(id);
var model = new StyleEditViewModel
{
@@ -104,4 +105,4 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
return this.View(model);
}
}
}
}

View File

@@ -18,8 +18,8 @@ public class TitreController : Controller
private readonly IArtisteRepository artisteRepository;
private readonly IStyleRepository styleRepository;
/// <summary>
/// Initializes a new instance of the <see cref="TitreController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="TitreController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté.</param>

View File

@@ -9,13 +9,15 @@
/// Définit l'identifiant de l'artiste.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Définit le nom de l'artiste.
/// </summary>
public string Nom { get; set; }
/// <summary>
/// Définit la biographie de l'artiste.
/// </summary>
public string Biographie { get; set; }
}
}
}

View File

@@ -1,5 +1,5 @@
// <copyright file="CommentaireViewModel.cs" company="Webzine">
// Copyright (c) Webzine. All rights reserved.
// <copyright file="CommentaireViewModel.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire

View File

@@ -8,7 +8,7 @@ public class DashboardViewModel
/// <summary>
/// Définit le nombre total d'artistes chroniqués dans le webzine.
/// </summary>
public int NombreArtistes { get; set; }
public int NombreArtistes { get; set; }
/// <summary>
/// Définit le nom de l'artiste le plus chroniqué dans le webzine.
@@ -29,6 +29,7 @@ public class DashboardViewModel
/// Définit l'identifiant de la biographie d'artiste la plus lue dans le webzine.
/// </summary>
public int IdMusiqueLaPlusJouee { get; set; }
/// <summary>
/// Définit le nom de la biographie d'artiste la plus lue dans le webzine.
/// </summary>

View File

@@ -1,20 +1,17 @@
// <copyright file="StyleDeleteViewModel.cs" company="Webzine">
// Copyright (c) Webzine. Tout droit réservé.
// <copyright file="StyleCreateViewModel.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style
{
/// <summary>
/// ViewModel pour la création d'un style en administration.
/// </summary>
public class StyleCreateViewModel
{
/// <summary>
/// Obtient ou définit le libellé du style.
/// </summary>
public string Libelle { get; set; }
}
}
}

View File

@@ -1,26 +1,22 @@
// <copyright file="StyleDeleteViewModel.cs" company="Webzine">
// Copyright (c) Webzine. Tout droit réservé.
// <copyright file="StyleDeleteViewModel.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style
{
/// <summary>
/// ViewModel pour la suppression d'un style en administration.
/// </summary>
public class StyleDeleteViewModel
{
/// <summary>
/// Obtient ou définit l'identifiant du style à supprimer.
/// </summary>
public int IdStyle { get; set; }
/// <summary>
/// Obtient ou définit le libellé du style.
/// </summary>
public string Libelle { get; set; }
}
}
}

View File

@@ -1,27 +1,22 @@
// <copyright file="StyleDeleteViewModel.cs" company="Webzine">
// Copyright (c) Webzine. Tout droit réservé.
// <copyright file="StyleEditViewModel.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style
{
/// <summary>
/// ViewModel pour la modification d'un style en administration.
/// </summary>
public class StyleEditViewModel
{
/// <summary>
/// Obtient ou définit le libellé du style.
/// </summary>
public int IdStyle { get; set; }
/// <summary>
/// Obtient ou définit le libellé du style.
/// </summary>
public string Libelle { get; set; }
}
}
}

View File

@@ -65,7 +65,7 @@ public class AdminTitreForm
/// <summary>
/// Définit la liste des identifiants des styles associés au titre.
/// </summary>
public List<int> Styles { get; set; } = new();
public List<int> Styles { get; set; } = new ();
/// <summary>
/// Définit la liste des artistes disponibles pour la sélection dans le formulaire de création ou de modification d'un titre.

View File

@@ -1,10 +1,11 @@
// <copyright file="AccueilController.cs" company=" Equipe 1 - ">
// Copyright (c) Equipe 1 - . All rights reserved.
// <copyright file="AccueilController.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.ViewModels.Accueil;
@@ -19,6 +20,7 @@ namespace Webzine.WebApplication.Controllers
private readonly ITitreRepository titreRepository;
/// <summary>
/// Initializes a new instance of the <see cref="AccueilController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="AccueilController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté pour enregistrer les événements et les erreurs.</param>
@@ -63,4 +65,4 @@ namespace Webzine.WebApplication.Controllers
return this.View(vm);
}
}
}
}

View File

@@ -7,6 +7,7 @@ public class ApiController : ControllerBase
private readonly ILogger<ApiController> logger;
/// <summary>
/// Initializes a new instance of the <see cref="ApiController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="ApiController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté pour enregistrer les événements et les erreurs.</param>
@@ -25,10 +26,10 @@ public class ApiController : ControllerBase
{
this.logger.LogInformation("Get Version was called");
return Ok(new
{
nom = "webzine",
version = "2.0",
});
return this.Ok(new
{
nom = "webzine",
version = "2.0",
});
}
}

View File

@@ -1,6 +1,7 @@
namespace Webzine.WebApplication.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Entity.Fixtures;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.ViewModels.Artiste;
@@ -9,18 +10,20 @@
{
// Injection du logger via le constructeur
private readonly ILogger<ArtisteController> logger;
private readonly IArtisteRepository _artisteRepository;
private readonly IArtisteRepository artisteRepository;
/// <summary>
/// Initializes a new instance of the <see cref="ArtisteController"/> class.
/// Initialise une nouvelle instance du <see cref="ArtisteController"/>. avec un service de journalisation injecté.
/// </summary>
/// <param name="logger">Service de journalisation injecté pour enregistrer les événements et les erreurs.</param>
public ArtisteController(ILogger<ArtisteController> logger,
public ArtisteController(
ILogger<ArtisteController> logger,
IArtisteRepository artisteRepository)
{
this.logger = logger;
this.logger.LogDebug("Initialisation du ArtisteController");
this._artisteRepository = artisteRepository;
this.artisteRepository = artisteRepository;
}
/// <summary>
@@ -44,7 +47,7 @@
.ToTitleCase(nom.Replace("-", " "));
// On appelle la factory pour obtenir l'artiste unique
var artiste = this._artisteRepository.FindByName(nomPropre);
var artiste = this.artisteRepository.FindByName(nomPropre);
// Check if artiste was found
if (artiste == null)
@@ -68,4 +71,4 @@
return this.View(viewModel);
}
}
}
}

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
namespace Webzine.WebApplication.Controllers
namespace Webzine.WebApplication.Controllers
{
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// Controller pour la page contact.
/// </summary>
@@ -11,6 +11,7 @@ namespace Webzine.WebApplication.Controllers
private readonly ILogger<ContactController> logger;
/// <summary>
/// Initializes a new instance of the <see cref="ContactController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="ContactController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté pour enregistrer les événements et les erreurs.</param>
@@ -29,4 +30,4 @@ namespace Webzine.WebApplication.Controllers
return this.View();
}
}
}
}

View File

@@ -1,10 +1,11 @@
// <copyright file="RechercheController.cs" company=" Equipe 1 - ">
// Copyright (c) Equipe 1 - . All rights reserved.
// <copyright file="RechercheController.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.ViewModels.Recherche;
using Webzine.WebApplication.ViewModels.Titre;
@@ -65,4 +66,4 @@ namespace Webzine.WebApplication.Controllers
return this.View(vm);
}
}
}
}

View File

@@ -1,10 +1,11 @@
// <copyright file="TitreController.cs" company=" Equipe 1 - ">
// Copyright (c) Equipe 1 - . All rights reserved.
// <copyright file="TitreController.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Webzine.WebApplication.Controllers
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Entity;
using Webzine.Repository.Contracts;
using Webzine.WebApplication.ViewModels.Titre;
@@ -21,6 +22,7 @@ namespace Webzine.WebApplication.Controllers
private readonly ITitreRepository titreRepository;
/// <summary>
/// Initializes a new instance of the <see cref="TitreController"/> class.
/// Initialise une nouvelle instance de la classe <see cref="TitreController"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecte.</param>
@@ -168,4 +170,4 @@ namespace Webzine.WebApplication.Controllers
};
}
}
}
}

View File

@@ -18,6 +18,7 @@ try
// Ajoute les services necessaires pour permettre l'utilisation des
// controllers avec des vues.
builder.Services.AddControllersWithViews()
// Ajoute la compilation des vues lors de l'execution de l'application.
// Cela nous evite de recompiler l'application a chaque modification de vue.
// Necessite le package Nuget Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.
@@ -42,6 +43,7 @@ try
builder.Services.AddDbContext<WebzineDbContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("PostGreSQLConnection")));
}
builder.Services.AddScoped<DbEntityRepository>();
builder.Services.AddScoped<ITitreRepository, DbTitreRepository>();
builder.Services.AddScoped<IStyleRepository, DbStyleRepository>();
@@ -154,4 +156,4 @@ finally
{
// Assure que NLog flush tous les messages de log avant de fermer l'application.
LogManager.Shutdown();
}
}

View File

@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
namespace Webzine.WebApplication.ViewComponents
{
using Microsoft.AspNetCore.Mvc;
using Webzine.Repository.Contracts;
/// <summary>
/// View component pour la sidebar, récupère les styles depuis le repository.
/// </summary>

View File

@@ -1,6 +1,7 @@
namespace Webzine.WebApplication.ViewModels.Artiste
{
using Webzine.Entity;
/// <summary>
/// ViewModel pour afficher les informations d'un artiste et ses titres groupés par album.
/// </summary>
@@ -27,4 +28,4 @@
public IEnumerable<IGrouping<string?, Titre>> AlbumsGroupes { get; set; }
= Enumerable.Empty<IGrouping<string?, Titre>>();
}
}
}

View File

@@ -14,4 +14,4 @@ public class RechercheArtisteItem
/// Nombre de titres associes a l'artiste.
/// </summary>
public int NombreDeTitres { get; set; }
}
}

View File

@@ -15,10 +15,10 @@ public class RechercheIndexViewModel
/// <summary>
/// Artistes trouves.
/// </summary>
public List<RechercheArtisteItem> Artistes { get; set; } = new();
public List<RechercheArtisteItem> Artistes { get; set; } = new ();
/// <summary>
/// Titres trouves.
/// </summary>
public List<TitreStyleItem> Titres { get; set; } = new();
}
public List<TitreStyleItem> Titres { get; set; } = new ();
}

View File

@@ -50,10 +50,10 @@ public class TitreContent
/// <summary>
/// Définit le nom de l'album associé au titre.
/// </summary>
public List<Style> Styles { get; set; } = new();
public List<Style> Styles { get; set; } = new ();
/// <summary>
/// Définit la liste des commentaires associés au titre.
/// </summary>
public List<Commentaire> Commentaires { get; set; } = new();
public List<Commentaire> Commentaires { get; set; } = new ();
}

View File

@@ -13,5 +13,5 @@ public class TitreStyle
/// <summary>
/// Définit la liste des items de titre associés au style musical.
/// </summary>
public List<TitreStyleItem> Titres { get; set; } = new();
public List<TitreStyleItem> Titres { get; set; } = new ();
}