Mango.Nop.Libraries/docs/GLOSSARY.md

1.9 KiB

Glossary

Terminology for the Mango.Nop Libraries. Read this before working on unfamiliar areas.

Entity & DTO System

Term Definition
BaseEntity nopCommerce root entity base with int Id. Mirror copy in NopDependencies/.
MgEntityBase Custom entity base — inherits BaseEntity, implements IEntityInt (AyCode). Used for domain-specific entities (e.g., MgStockTaking).
ModelDtoBase<T> Abstract DTO base with bidirectional mapping: CopyEntityValuesToDto() reads from entity, CreateMainEntity() creates entity from DTO.
NopDependencies Mirror copies of nopCommerce entity classes in Mango.Nop.Core. Same namespaces as originals. Eliminates full nopCommerce dependency for consumers that only need types.
GenericAttribute nopCommerce polymorphic key-value store. KeyGroup = owner type name, EntityId = owner ID, Key = attribute name, Value = string value.

Data Access

Term Definition
MgDbTableBase<T> Repository base wrapping nopCommerce EntityRepository<T>. Adds GetAll(), automatic timestamp management, event publishing.
MgDtoDbTableBase DTO-aware repository — handles DTO ↔ entity mapping on top of MgDbTableBase.
MgDbContextBase EF Core DbContext base for custom (non-nopCommerce) tables.
MgDalBase Data Access Layer orchestrator — coordinates multiple repositories.

Services

Term Definition
MgBackgroundServiceBase Base for hosted background services within nopCommerce.
MgSessionServiceBase Session state management — tracks user sessions.
MgEventConsumerBase Base for nopCommerce entity event consumers (insert/update/delete notifications).
MgLockServiceBase Distributed lock service — prevents concurrent operations on shared resources.
NopLogWriter Logging bridge — writes to nopCommerce's built-in log system.