Add ToonDescription attributes for enhanced metadata support

Introduced Toon serialization/description attributes to CustomerDto, GenericAttribute, and OrderNote classes. Added table mapping and foreign key metadata, as well as necessary using statements, to improve serialization, documentation, and tooling capabilities.
This commit is contained in:
Loretta 2026-01-14 21:05:20 +01:00
parent 0eeefedee3
commit 7bcd601035
3 changed files with 15 additions and 3 deletions

View File

@ -1,8 +1,13 @@
using Nop.Core.Domain.Common;
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;
[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)])]
public class CustomerDto : ModelDtoBase<Customer>, ISoftDeletedEntity
{
public string Username { get; set; }

View File

@ -1,4 +1,6 @@
namespace Nop.Core.Domain.Common;
using AyCode.Core.Serializers.Toons;
namespace Nop.Core.Domain.Common;
/// <summary>
/// Represents a generic attribute
@ -8,6 +10,8 @@ public partial class GenericAttribute : BaseEntity
/// <summary>
/// Gets or sets the entity identifier
/// </summary>
///
[ToonDescription(Constraints = "polymorphic-fk(KeyGroup)")]
public int EntityId { get; set; }
/// <summary>

View File

@ -1,4 +1,6 @@
namespace Nop.Core.Domain.Orders;
using AyCode.Core.Serializers.Toons;
namespace Nop.Core.Domain.Orders;
/// <summary>
/// Represents an order note
@ -8,6 +10,7 @@ public partial class OrderNote : BaseEntity
/// <summary>
/// Gets or sets the order identifier
/// </summary>
[ToonDescription($"Foreign key to parent {nameof(Order)}", ForeignKey = nameof(Order))]
public int OrderId { get; set; }
/// <summary>