Commande dotnet format
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
namespace Webzine.Repository
|
||||
{
|
||||
using System.Data.Common;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using Webzine.EntitiesContext;
|
||||
using Webzine.Entity;
|
||||
using Webzine.Repository.Contracts;
|
||||
@@ -17,7 +19,7 @@ namespace Webzine.Repository
|
||||
/// </summary>
|
||||
public class DbArtisteRepository : IArtisteRepository
|
||||
{
|
||||
private WebzineDbContext context;
|
||||
private readonly WebzineDbContext context;
|
||||
private readonly ILogger<LocalArtisteRepository> logger;
|
||||
|
||||
/// <summary>
|
||||
@@ -115,7 +117,7 @@ namespace Webzine.Repository
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<Artiste> FindAll()
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
// .AsNoTracking() rend la requête beaucoup plus rapide pour de la lecture
|
||||
var artistes = this.context.Artistes.AsNoTracking().ToList();
|
||||
@@ -127,15 +129,15 @@ namespace Webzine.Repository
|
||||
this.logger.LogError(ex, "Erreur lors de la récupération de tous les artistes.");
|
||||
return Enumerable.Empty<Artiste>(); // Retourne une liste vide au lieu de faire crash l'UI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Update(Artiste artiste)
|
||||
{
|
||||
if (artiste == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(artiste));
|
||||
}
|
||||
{
|
||||
throw new ArgumentNullException(nameof(artiste));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user