diff --git a/backend/Infrastructure/Repositories/Organization/OrganizationCacheRepository.cs b/backend/Infrastructure/Repositories/Organization/OrganizationCacheRepository.cs deleted file mode 100644 index ef549725..00000000 --- a/backend/Infrastructure/Repositories/Organization/OrganizationCacheRepository.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Core.Organizations; -using Microsoft.Extensions.Caching.Memory; - -namespace Infrastructure.Repositories.Organization; - -public class OrganizationCacheRepository(IOrganisationRepository sourceRepository, IMemoryCache cache) - : IOrganisationRepository -{ - private const string CacheKey = "orgCacheKey"; - - public async Task GetOrganizationByUrlKey(string urlKey, - CancellationToken cancellationToken) - { - if (cache.TryGetValue($"{CacheKey}/{urlKey}", out var organization)) - if (organization is not null) - return organization; - - organization = await sourceRepository.GetOrganizationByUrlKey(urlKey, cancellationToken); - cache.Set($"{CacheKey}/{urlKey}", organization); - - return organization; - } -} \ No newline at end of file diff --git a/backend/Infrastructure/Repositories/RepositoryExtensions.cs b/backend/Infrastructure/Repositories/RepositoryExtensions.cs index bc2bc517..c41fd4ff 100644 --- a/backend/Infrastructure/Repositories/RepositoryExtensions.cs +++ b/backend/Infrastructure/Repositories/RepositoryExtensions.cs @@ -18,7 +18,6 @@ public static class RepositoryExtensions public static void AddRepositories(this WebApplicationBuilder builder) { builder.Services.AddScoped(); - builder.Services.Decorate(); builder.Services.AddScoped(); builder.Services.AddScoped();