« Unit of Work Pattern » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
Ligne 1 : | Ligne 1 : | ||
[[Category:Design | [[Category:Design Patterns]] | ||
[[Category:.NET Core]] | [[Category:.NET Core]] | ||
= Links = | = Links = |
Version du 9 mars 2025 à 11:50
Links
Description
Used to manage transactions and ensure data consistency across multiple operations.
Key Components and Benefits:
- Transaction Management: ensures that multiple database operations are treated as a single transaction. This means that either all operations succeed or none of them do, maintaining data integrity and consistency.
- Repository Coordination: It coordinates the work of multiple repositories by using a shared database context. This allows for efficient management of complex transactions involving multiple entities.
- Scalability: As the number of repositories increases, it helps manage complexity by ensuring all operations participate in the same transaction.
- Persistence Ignorance: It abstracts the underlying data access technology, allowing developers to switch between different data access frameworks like EF Core, Dapper, or ADO.NET without affecting the business logic.
Implementation
UnitOfWork.cs |