Skip to content

Commit

Permalink
Cached Repository class/interface
Browse files Browse the repository at this point in the history
  • Loading branch information
goodtocode committed Jul 10, 2023
1 parent 65d7bc9 commit e6fc4c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

namespace Goodtocode.Common.Persistence.Repository;

public class CacheRepository<T> : ICacheRepository<T> where T : class
public class CachedRepository<T> : ICachedRepository<T> where T : class
{
private readonly static CacheTypes CacheType = CacheTypes.Memory;
private readonly string cacheKey = $"{typeof(T)}";
private readonly DbContext _dbContext;
private readonly Func<CacheTypes, ICacheService> _cacheService;

public CacheRepository(DbContext dbContext, Func<CacheTypes, ICacheService> cacheService)
public CachedRepository(DbContext dbContext, Func<CacheTypes, ICacheService> cacheService)
{
_dbContext = dbContext;
_cacheService = cacheService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Goodtocode.Common.Persistence.Repository;

public interface ICacheRepository<T> where T : class
public interface ICachedRepository<T> where T : class
{
Task<T> GetByIdAsync(int id);
Task<IReadOnlyList<T>> GetAllAsync();
Expand Down

0 comments on commit e6fc4c5

Please sign in to comment.