#106 Ajout du mode Repositories Local
This commit is contained in:
43
Webzine.Repository/LocalCommentaireRepository.cs
Normal file
43
Webzine.Repository/LocalCommentaireRepository.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user