1.5 KiB
1.5 KiB
MAPO-CORE Agent Instructions
Core Context
- Primary Goal: Optimization and refactoring of the
MP-SPEC.slnsolution, focusing on migrating legacy Redis/DB caching toFusionCache(Memory + Redis + DB) inMP.SPEC\Data\MpDataService.cs. - Language: C# (primary), PowerShell (scripts).
- Documentation/Comments: MUST be in Italiano.
- Code Style: Maintain existing region organization (
#region Public Methods, etc.).
Development Workflow
- Build & Verification:
- Use a PowerShell script to build the solution to ensure continuous compilability.
- Always verify that changes do not leave partial traces of old classes that break compilation.
- Refactoring Strategy (
MpDataService.cs):- Use
GetOrFetchAsync<T>(string operationName, string cacheKey, Func<Task<T>> fetchFunc, TimeSpan expiration, params string[] tags)as the standard for all data access. - Target methods currently using manual
redisDb.StringGetAsync/StringSetAsyncpatterns.
- Use
- Testing:
- Check the codebase for existing testing patterns before proposing new ones.
Architecture Notes
- Multi-Layer Caching: The system is transitioning from a dual-layer (Redis + DB) to a triple-layer approach via
IFusionCache. - Service Responsibility:
MpDataServiceis the central hub for data access, interacting withMpSpecController(EFCore) andMpMongoController(MongoDB). - Key Management: Cache keys are heavily managed via
Utils.redis...constants.