AyCode.Core/AyCode.Database/DataLayers/README.md

20 lines
905 B
Markdown

# DataLayers
Generic Data Access Layer (DAL) abstraction with mutex-protected session/transaction patterns and singleton DAL pooling.
## Key Files
- **`IAcDalBase.cs`** — Base interface: Name, Context access, Mutex lock, DbContext lifecycle.
- **`AcDalBase.cs`** — Abstract implementation: Session/SessionAsync (reads), Transaction/TransactionAsync (writes), thread-safe Mutex, auto DbContext creation, model DTO conversion.
- **`PooledDal.cs`** — Singleton DAL pool: concurrent dictionary by SessionId/PlayerId, GetDalById, CreateDal, Remove.
## Subfolders
| Folder | Purpose |
|---|---|
| [`Users/`](Users/README.md) | User-specific DAL with authentication and CRUD |
---
> **LLM Maintenance:** If you modify code in this folder, update this README to reflect the changes. If you notice the README content does not match the current code, automatically update the README to match the code.