Refactor EnvelopeType handling and introduce caching
Updated `EnvelopeDto` to use `EnvelopeTypeDefaultsDto` for the `Defaults` property, decoupling domain entities from external layers. Refactored `IEnvelopeTypeRepository`, `IEnvelopeTypeService`, and `EnvelopeTypeService` to use `EnvelopeType` as the identifier type instead of `int`, improving domain specificity and consistency. Introduced caching in `EnvelopeTypeService` with a static `CacheKey` and `IMemoryCache` dependency for performance optimization. Aligned `EnvelopeTypeRepository` with the updated identifier type and repository interface.
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
using DigitalData.Core.Infrastructure;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories;
|
||||
|
||||
[Obsolete("Use IRepository")]
|
||||
public class EnvelopeTypeRepository : CRUDRepository<EnvelopeTypeDefaults, int, EGDbContext>, IEnvelopeTypeRepository
|
||||
public class EnvelopeTypeRepository : CRUDRepository<EnvelopeTypeDefaults, EnvelopeType, EGDbContext>, IEnvelopeTypeRepository
|
||||
{
|
||||
public EnvelopeTypeRepository(EGDbContext dbContext) : base(dbContext, dbContext.EnvelopeTypes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user