#106 Ajout du mode Repositories Local

This commit is contained in:
Loic Masi
2026-03-26 18:48:41 +01:00
parent c95f77b6e6
commit d65d21ea64
14 changed files with 302 additions and 495 deletions

View File

@@ -0,0 +1,43 @@
// <copyright file="LocalCommentaireRepository.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using Webzine.Entity;
using Webzine.Repository.Contracts;
namespace Webzine.Repository
{
public class LocalCommentaireRepository : ICommentaireRepository
{
private readonly InMemoryDataStore dataStore;
public LocalCommentaireRepository(InMemoryDataStore dataStore)
{
this.dataStore = dataStore;
}
/// <inheritdoc/>
public void Add(Commentaire commentaire)
{
throw new NotSupportedException();
}
/// <inheritdoc/>
public void Delete(Commentaire commentaire)
{
throw new NotSupportedException();
}
/// <inheritdoc/>
public Commentaire Find(int id)
{
return this.dataStore.Commentaires.Find(c => c.IdCommentaire == id);
}
/// <inheritdoc/>
public IEnumerable<Commentaire> FindAll()
{
return this.dataStore.Commentaires.ToList();
}
}
}