Mango.Nop.Libraries/Mango.Nop.Core
Loretta 65bf004808 Update AcBinarySerializable attribute signature
Updated all affected entities to use the new AcBinarySerializable attribute signature, adding an extra boolean parameter (false) as the last argument. No other logic or code was changed.
2026-05-15 08:41:59 +02:00
..
.github [LOADED_DOCS: 2 files, no new loads] 2026-05-05 15:06:06 +02:00
Dtos Update AcBinarySerializable attribute signature 2026-05-15 08:41:59 +02:00
Entities Add ToonDescription attributes to core entities and DTOs 2026-01-15 11:34:06 +01:00
Extensions improvements, fixes 2025-11-26 09:42:07 +01:00
Interfaces improvements, fixes 2025-11-26 09:42:07 +01:00
Loggers refactoring, cleanup, etc... 2025-10-22 15:16:20 +02:00
Models Minimal SignalR test hub and endpoint for isolated testing 2025-12-11 23:46:36 +01:00
NopDependencies Update AcBinarySerializable attribute signature 2026-05-15 08:41:59 +02:00
Services SignalR improvements; etc... 2025-10-30 14:54:33 +01:00
Utils Mango.Nop.Core cleanup; 2025-11-05 14:56:40 +01:00
docs Refactor docs: topic folders, navigation, protocol sync 2026-04-25 07:24:39 +02:00
AcBinaryForcedInit.cs Enforce doc-first protocol, add SGen, modular plugin docs 2026-04-02 22:19:29 +02:00
Mango.Nop.Core.csproj Refactor docs: topic folders, navigation, protocol sync 2026-04-25 07:24:39 +02:00
NopCommonConst.cs
README.md Refactor docs: topic folders, navigation, protocol sync 2026-04-25 07:24:39 +02:00

README.md

Mango.Nop.Core

@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)" ] }

Shared domain library containing entities, DTOs, interfaces, and nopCommerce entity mirrors. net9.0. Zero nopCommerce runtime dependency.

Documentation

Document Topic
DTOS.md DTO system — two mapping strategies, all DTO types, GenericAttribute typed access
NOP_DEPENDENCIES.md NopDependencies pattern — mirror copies, namespace rules, file list

Folder Structure

Folder Purpose
Dtos/ DTO classes shared across consumers
Entities/ Custom domain entities
Extensions/ Extension methods for BaseEntity collections and GenericAttribute
Interfaces/ DTO interfaces, soft-delete, foreign key markers
Loggers/ ILogger / Logger — logging abstraction wrapping AyCode logger
Models/ Login request/response models
NopDependencies/ Mirror copies of nopCommerce entity classes (same namespaces as originals)
Services/ IMgLockService interface
Utils/ CommonHelper2 — email validation, type conversion utilities

Entity Hierarchy

Nop.Core.BaseEntity (NopDependencies/, implements IBaseEntity)
  +-- MgEntityBase (Entities/, implements IEntityInt from AyCode)
        +-- MgOrderDto<TOrderItemDto, TProductDto>
        +-- MgOrderItemDto<TProductDto>
        +-- MgProductDto
        +-- MgStockQuantityHistoryDto<TProductDto>
        +-- MgStockTaking<TStockTakingItem>
        +-- MgStockTakingItem<TStockTaking, TProduct>

Key Types (not in docs/)

Entities

Type Key features
MgEntityBase Inherits BaseEntity, implements IEntityInt. ToString() -> "{TypeName}; Id: {Id}"
MgStockTaking<TStockTakingItem> StartDateTime, IsClosed, List<TStockTakingItem> navigation. Implements ITimeStampInfo
MgStockTakingItem<TStockTaking, TProduct> StockTakingId, ProductId, IsMeasured, stock quantities. Navigations to parent and product

Extensions

Method Purpose
UpdateBaseEntityCollection Add/update/remove entities in a list by Id match

Loggers

Extends AyCode logging infrastructure — for base types see AyCode.Core/AyCode.Core/docs/LOGGING/README.md.

Type Inherits Purpose
ILogger IAcLoggerBase Mango-level logger interface
ILogger<TCategory> ILogger Generic category logger interface
Logger AcLoggerBase Logger implementation with IAcLogWriterBase[] writers
Logger<TCategory> Logger Typed logger — category name from typeof(TCategory).Name

Models

Type Purpose
MgLoginModelRequest Email + Password for SignalR/API login
MgLoginModelResponse CustomerDto? + ErrorMessage. Computed IsSuccesLogin

Other

Type Purpose
NopCommonConst Abstract const class inheriting AcConst (placeholder)
CommonHelper2 Email validation, IP validation, type conversion (To<T>), string utilities

Dependencies

  • linq2db — data access, [Association] / [Table] attributes
  • Microsoft.AspNetCore.Mvc.NewtonsoftJson — JSON serialization
  • Binary serialization: AcBinarySerializer (see AyCode.Core/AyCode.Core/docs/BINARY/BINARY_FORMAT.md). SignalR transport: AcSignalR (see AyCode.Core/AyCode.Services/docs/SIGNALR/README.md).
  • AyCode.Core.Serializers.SourceGenerator (ProjectReference, OutputItemType="Analyzer") — compile-time binary serializer. See AyCode.Core/docs/BINARY_SOURCE_GEN.md
  • AyCode DLL references: AyCode.Interfaces, AyCode.Core, AyCode.Utils, AyCode.Entities (types only, no runtime nopCommerce dependency)

AcBinary Source Generator (SGen)

9 types annotated with [AcBinarySerializable]. For general SGen docs see AyCode.Core/docs/BINARY_SOURCE_GEN.md.

Requires InternalsVisibleTo("Mango.Nop.Core") in AyCode.Core/Properties/AssemblyInfo.cs.

Excluded types

Type Reason
DiscountProductMapping Base DiscountMapping hides BaseEntity.Id with readonly new int Id { get; } → CS0200. Uses compiled-expression fallback.