Files
mapo-core/AGENTS.md
T

23 lines
1.5 KiB
Markdown

# MAPO-CORE Agent Instructions
## Core Context
- **Primary Goal**: Optimization and refactoring of the `MP-SPEC.sln` solution, focusing on migrating legacy Redis/DB caching to `FusionCache` (Memory + Redis + DB) in `MP.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` / `StringSetAsync` patterns.
- **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**: `MpDataService` is the central hub for data access, interacting with `MpSpecController` (EFCore) and `MpMongoController` (MongoDB).
- **Key Management**: Cache keys are heavily managed via `Utils.redis...` constants.