From ced4b989083ae6647a257d01633494c01105361f Mon Sep 17 00:00:00 2001 From: Loretta Date: Fri, 20 Mar 2026 17:06:49 +0100 Subject: [PATCH] Add serialization attributes and update to PROD config Annotated core entities with AcBinarySerializable and ToonDescription for improved serialization and documentation. Updated appsettings.json to use the production database. Changed solution file to target Visual Studio 17. Added necessary using statements and metadata for entity classes. --- Mango.Nop.Core/Dtos/CustomerDto.cs | 4 +++- Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs | 4 +++- Mango.Nop.Core/NopDependencies/Catalogs/CustomerRole.cs | 5 ++++- .../NopDependencies/Catalogs/DiscountProductMapping.cs | 5 ++++- Mango.Nop.Core/NopDependencies/Catalogs/GenericAttribute.cs | 4 +++- Mango.Nop.Core/NopDependencies/Catalogs/Order.cs | 5 +++-- Mango.Nop.Core/NopDependencies/Catalogs/OrderItem.cs | 3 +++ Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs | 4 +++- Mango.Nop.Core/NopDependencies/Catalogs/Product.cs | 6 ++++-- .../NopDependencies/Catalogs/StockQuantityHistory.cs | 4 +++- 10 files changed, 33 insertions(+), 11 deletions(-) diff --git a/Mango.Nop.Core/Dtos/CustomerDto.cs b/Mango.Nop.Core/Dtos/CustomerDto.cs index 28b7866..8f3b9e6 100644 --- a/Mango.Nop.Core/Dtos/CustomerDto.cs +++ b/Mango.Nop.Core/Dtos/CustomerDto.cs @@ -1,10 +1,12 @@ -using AyCode.Core.Serializers.Toons; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; using Nop.Core.Domain.Catalog; using Nop.Core.Domain.Common; using Nop.Core.Domain.Customers; namespace Mango.Nop.Core.Dtos; +[AcBinarySerializable(false, true, false, true)] [LinqToDB.Mapping.Table(Name = nameof(Customer))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(Customer))] [ToonDescription($"Data transfer object for {nameof(Customer)}", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(Customer)])] diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs b/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs index 0b8e254..4acf568 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/Customer.cs @@ -1,4 +1,5 @@ -using AyCode.Core.Serializers.Toons; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; using Nop.Core.Domain.Common; using Nop.Core.Domain.Tax; @@ -7,6 +8,7 @@ namespace Nop.Core.Domain.Customers; /// /// Represents a customer /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("NopCommerce customer entity")] public partial class Customer : BaseEntity, ISoftDeletedEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/CustomerRole.cs b/Mango.Nop.Core/NopDependencies/Catalogs/CustomerRole.cs index 3ea2215..38dd8f5 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/CustomerRole.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/CustomerRole.cs @@ -1,8 +1,11 @@ -namespace Nop.Core.Domain.Customers; +using AyCode.Core.Serializers.Attributes; + +namespace Nop.Core.Domain.Customers; /// /// Represents a customer role /// +[AcBinarySerializable(false, true, false, true)] public partial class CustomerRole : BaseEntity { /// diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/DiscountProductMapping.cs b/Mango.Nop.Core/NopDependencies/Catalogs/DiscountProductMapping.cs index d7bcaf8..2e2adb6 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/DiscountProductMapping.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/DiscountProductMapping.cs @@ -1,8 +1,11 @@ -namespace Nop.Core.Domain.Discounts; +using AyCode.Core.Serializers.Attributes; + +namespace Nop.Core.Domain.Discounts; /// /// Represents a discount-product mapping class /// +[AcBinarySerializable(false, true, false, true)] public partial class DiscountProductMapping : DiscountMapping { /// diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/GenericAttribute.cs b/Mango.Nop.Core/NopDependencies/Catalogs/GenericAttribute.cs index d3159bd..b4f44fc 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/GenericAttribute.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/GenericAttribute.cs @@ -1,10 +1,12 @@ -using AyCode.Core.Serializers.Toons; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; namespace Nop.Core.Domain.Common; /// /// Represents a generic attribute /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("NopCommerce generic attribute for key-value storage", Purpose = "A flexible key-value store used to extend entities with custom business logic data without changing the database schema")] public partial class GenericAttribute : BaseEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/Order.cs b/Mango.Nop.Core/NopDependencies/Catalogs/Order.cs index bb0fce1..5e6741b 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/Order.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/Order.cs @@ -1,6 +1,6 @@ -using Nop.Core.Domain.Common; +using AyCode.Core.Serializers.Attributes; using AyCode.Core.Serializers.Toons; - +using Nop.Core.Domain.Common; using Nop.Core.Domain.Payments; using Nop.Core.Domain.Shipping; using Nop.Core.Domain.Tax; @@ -10,6 +10,7 @@ namespace Nop.Core.Domain.Orders; /// /// Represents an order /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("NopCommerce order entity with payment and shipping")] public partial class Order : BaseEntity, ISoftDeletedEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/OrderItem.cs b/Mango.Nop.Core/NopDependencies/Catalogs/OrderItem.cs index 2138f47..4a8a835 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/OrderItem.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/OrderItem.cs @@ -1,10 +1,13 @@ namespace Nop.Core.Domain.Orders; + +using AyCode.Core.Serializers.Attributes; using AyCode.Core.Serializers.Toons; /// /// Represents an order item /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("NopCommerce order item entity")] public partial class OrderItem : BaseEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs b/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs index e922796..ed247c5 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs @@ -1,10 +1,12 @@ -using AyCode.Core.Serializers.Toons; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; namespace Nop.Core.Domain.Orders; /// /// Represents an order note /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("NopCommerce order note entity")] public partial class OrderNote : BaseEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs b/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs index 490929d..575b9e6 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/Product.cs @@ -1,16 +1,18 @@ -using Nop.Core.Domain.Common; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; +using Nop.Core.Domain.Common; using Nop.Core.Domain.Discounts; using Nop.Core.Domain.Localization; using Nop.Core.Domain.Security; using Nop.Core.Domain.Seo; using Nop.Core.Domain.Stores; -using AyCode.Core.Serializers.Toons; namespace Nop.Core.Domain.Catalog; /// /// Represents a product /// +[AcBinarySerializable(false, true, false, true)] [ToonDescription("Core nopCommerce product entity with catalog, pricing, and inventory management")] public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported, IDiscountSupported, ISoftDeletedEntity { diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/StockQuantityHistory.cs b/Mango.Nop.Core/NopDependencies/Catalogs/StockQuantityHistory.cs index 1e1bbc4..af7955e 100644 --- a/Mango.Nop.Core/NopDependencies/Catalogs/StockQuantityHistory.cs +++ b/Mango.Nop.Core/NopDependencies/Catalogs/StockQuantityHistory.cs @@ -1,4 +1,5 @@ -using AyCode.Core.Serializers.Toons; +using AyCode.Core.Serializers.Attributes; +using AyCode.Core.Serializers.Toons; using AyCode.Interfaces.Entities; using LinqToDB.Mapping; using Mango.Nop.Core.Interfaces; @@ -19,6 +20,7 @@ public interface IMgStockQuantityHistory /// /// Represents a stock quantity change entry /// +[AcBinarySerializable(false, true, false, true)] [Table(Name = nameof(StockQuantityHistory))] [ToonDescription("NopCommerce stock movement log", Purpose = "Audit trail for physical and logical stock movements")] public partial class StockQuantityHistory : BaseEntity, IMgStockQuantityHistory