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:
@@ -7,6 +7,7 @@ using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Application.Common.Dto;
|
||||
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services;
|
||||
|
||||
@@ -14,7 +15,7 @@ namespace EnvelopeGenerator.Application.Services;
|
||||
///
|
||||
/// </summary>
|
||||
[Obsolete("Use MediatR")]
|
||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDefaultsDto, EnvelopeTypeDefaults, int>, IEnvelopeTypeService
|
||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDefaultsDto, EnvelopeTypeDefaults, EnvelopeType>, IEnvelopeTypeService
|
||||
{
|
||||
private static readonly Guid CacheKey = Guid.NewGuid();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user