# Mango.Nop.Data @project { type = "framework" own-dep-projects = [ "AyCode.Core, AyCode.Core.Server, AyCode.Entities, AyCode.Entities.Server, AyCode.Interfaces, AyCode.Interfaces.Server, AyCode.Utils (in AyCode.Core repo)" ] } Data access layer with repository base classes and DB context abstractions. **net9.0**. ## Documentation | Document | Topic | |---|---| | `REPOSITORIES.md` | MgDbTableBase, MgDtoDbTableBase — CRUD hooks, timestamps, delete rules, event bridging | | `TRANSACTIONS.md` | MgDbContextBase — 4 transaction methods, lock strategy, callback contract | ## Folder Structure | Folder | Purpose | |---|---| | `Interfaces/` | Repository interfaces: `IMgDalBase`, `IMgDbContextBase`, `IMgDbTableBase` | | `Repositories/` | Repository base implementations: `MgDalBase`, `MgDbContextBase`, `MgDbTableBase`, `MgDtoDbTableBase` | ## Inheritance Chains ### Repository hierarchy ``` nopCommerce EntityRepository (Nop.Data) +-- MgDbTableBase +-- MgDtoDbTableBase ``` ### Context hierarchy ``` MgDbContextBase (abstract, implements IMgDbContextBase) +-- [Consumer DbContexts in plugins] ``` ### DAL hierarchy ``` MgDalBase (implements IMgDalBase) +-- [Consumer DALs in plugins] ``` ## Interfaces | Interface | Purpose | |---|---| | `IMgDbTableBase` | Marker interface for repository classes | | `IMgDbContextBase` | Contract: `Logger`, `DataProvider`, `Orders`, `Products`, 4 transaction methods | | `IMgDalBase` | `Name` property | | `IMgDalBase` | `Context`, `MutextLock` — typed access to DB context | ## Dependencies - `Mango.Nop.Core` (ProjectReference) - `Nop.Core`, `Nop.Data` (nopCommerce ProjectReferences) - `Microsoft.AspNetCore.Mvc.NewtonsoftJson`