From 15680746b0407d97b10fbd7f2b60f8ed6dc7c72d Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 16 Jan 2026 13:30:30 +0100 Subject: [PATCH] Refactor: add TODOs for generic repository pattern Added TODO comments in ICatalogRepository and CatalogRepository to suggest adopting a generic repository pattern to reduce code duplication. Also noted the potential move of the interface to the application layer for better adherence to clean architecture principles. --- DbFirst.Domain/Repositories/ICatalogRepository.cs | 2 ++ DbFirst.Infrastructure/Repositories/CatalogRepository.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DbFirst.Domain/Repositories/ICatalogRepository.cs b/DbFirst.Domain/Repositories/ICatalogRepository.cs index 7821577..6777ef3 100644 --- a/DbFirst.Domain/Repositories/ICatalogRepository.cs +++ b/DbFirst.Domain/Repositories/ICatalogRepository.cs @@ -2,6 +2,8 @@ using DbFirst.Domain.Entities; namespace DbFirst.Domain.Repositories; +// TODO: instead of creating interface per entity, consider using generic repository pattern (eg. IRepository) to reduce code duplication. +//TODO: move to application layer as a part of clean architecture public interface ICatalogRepository { Task> GetAllAsync(CancellationToken cancellationToken = default); diff --git a/DbFirst.Infrastructure/Repositories/CatalogRepository.cs b/DbFirst.Infrastructure/Repositories/CatalogRepository.cs index 42b9f45..7823d61 100644 --- a/DbFirst.Infrastructure/Repositories/CatalogRepository.cs +++ b/DbFirst.Infrastructure/Repositories/CatalogRepository.cs @@ -6,7 +6,7 @@ using System.Data; namespace DbFirst.Infrastructure.Repositories; -// TODO: instead of creating implementation of repository per entity, consider using generic repository pattern (eg. IRepository) to reduce code duplication. +// TODO: instead of creating implementation of repository per entity, consider using generic repository pattern (eg. Repository) to reduce code duplication. public class CatalogRepository : ICatalogRepository { private readonly ApplicationDbContext _db;