refactor: update namespaces and improve null handling in view models and controllers

This commit is contained in:
mirage
2026-04-03 16:46:11 +02:00
parent a3421bbdf0
commit 2550d39af5
12 changed files with 22 additions and 23 deletions

View File

@@ -97,12 +97,15 @@ public class ArtisteController : Controller
[HttpPost]
public IActionResult Edit(ArtisteEditViewModel model)
{
var artiste = new Artiste
var artiste = this.artisteRepository.Find(model.Id);
if (artiste == null)
{
IdArtiste = model.Id,
Nom = model.Nom,
Biographie = model.Biographie,
};
return this.RedirectToAction("Index");
}
artiste.Nom = model.Nom;
artiste.Biographie = model.Biographie;
this.artisteRepository.Update(artiste);