Skip to content

Commit

Permalink
feat: refactored repos to use caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaaak committed Sep 25, 2023
1 parent 70904da commit ac594b4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using ClientsMicroservice.Data.Context;
using RealEstate.Shared.Data.Cache;

namespace RealEstate.Shared.Data.Repository
{
public class ClientsDbRepository : Repository, IClientsDbRepository
{
public ClientsDbRepository(ClientsDBContext context)
public ClientsDbRepository(ClientsDBContext context, ICacheService cacheService)
{
Context = context;
_cacheService = cacheService;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using ContractsMicroservice.Data.Context;
using RealEstate.Shared.Data.Cache;

namespace RealEstate.Shared.Data.Repository
{
public class ContractsDbRepository : Repository, IContractsDbRepository
{
public ContractsDbRepository(ContractsDBContext context)
public ContractsDbRepository(ContractsDBContext context, ICacheService cacheService)
{
Context = context;
_cacheService = cacheService;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using RealEstate.Shared.Data.Context;
using RealEstate.Shared.Data.Cache;
using RealEstate.Shared.Data.Context;

namespace RealEstate.Shared.Data.Repository
{
public class EstatesDbRepository : Repository, IEstatesDbRepository
{
public EstatesDbRepository(EstatesDBContext context)
public EstatesDbRepository(EstatesDBContext context, ICacheService cacheService)
{
Context = context;
_cacheService = cacheService;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using ListingsMicroservice.Data.Context;
using ListingsMicroservice.Data.Repository;
using RealEstate.Shared.Data.Cache;

namespace RealEstate.Shared.Data.Repository
{
public class ListingsDbRepository : Repository, IListingsDbRepository
{
public ListingsDbRepository(ListingsDBContext context)
public ListingsDbRepository(ListingsDBContext context, ICacheService cacheService)
{
Context = context;
Context = context;
_cacheService = cacheService;
}
}
}
4 changes: 3 additions & 1 deletion RealEstate.Shared/Data/Repository/ApplicationDbRepository.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using Microsoft.EntityFrameworkCore;
using RealEstate.Shared.Data.Cache;

namespace RealEstate.Shared.Data.Repository
{
public class ApplicationDbRepository : Repository, IApplicationDbRepository
{
public ApplicationDbRepository(DbContext context)
public ApplicationDbRepository(DbContext context, ICacheService cacheService)
{
Context = context;
_cacheService = cacheService;
}
}
}

0 comments on commit ac594b4

Please sign in to comment.