Refactor AcToonSerializer metadata extraction & DTO tables

- Remove redundant constraints (nullable, numeric, boolean) from metadata; only explicit [Required] is documented.
- Exclude enum values from constraints; add "readonly" for readonly/init-only properties.
- Filter out primitives from documented types; only complex types and enums are included.
- Detect and document enum backing fields with "enum-type" constraint.
- Only output descriptions if explicitly provided; no fallback/inferred text.
- Add "not-mapped" constraint for [NotMapped]/[NotColumn] properties.
- Switch FruitBankHybrid.Shared.Tests.csproj to direct AyCode.Core project reference.
- Add both LinqToDB and DataAnnotations [Table] attributes to DTOs for ORM compatibility.
This commit is contained in:
Loretta 2026-01-13 08:25:28 +01:00
parent 6d689d3632
commit 18b119c7a8
6 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,10 @@
using Mango.Nop.Core.Dtos;
using Nop.Core.Domain.Common;
namespace FruitBank.Common.Dtos;
[LinqToDB.Mapping.Table(Name = nameof(GenericAttribute))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(GenericAttribute))]
public class GenericAttributeDto : MgGenericAttributeDto
{

View File

@ -20,6 +20,8 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos;
[LinqToDB.Mapping.Table(Name = nameof(Order))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(Order))]
public class OrderDto : MgOrderDto<OrderItemDto, ProductDto>, IOrderDto
{
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]

View File

@ -14,6 +14,8 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos;
[LinqToDB.Mapping.Table(Name = nameof(OrderItem))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(OrderItem))]
public class OrderItemDto : MgOrderItemDto<ProductDto>, IOrderItemDto
{
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]

View File

@ -11,6 +11,8 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos;
[LinqToDB.Mapping.Table(Name = "Product")]
[System.ComponentModel.DataAnnotations.Schema.Table("Product")]
public class ProductDto : MgProductDto, IProductDto
{
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]

View File

@ -14,6 +14,8 @@ using System.Threading.Tasks;
namespace FruitBank.Common.Dtos
{
[LinqToDB.Mapping.Table(Name = nameof(StockQuantityHistory))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(StockQuantityHistory))]
public class StockQuantityHistoryDto : MgStockQuantityHistoryDto<ProductDto>, IStockQuantityHistoryDto
{
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]

View File

@ -20,15 +20,13 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Core\AyCode.Core.csproj" />
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
<ProjectReference Include="..\FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj" />
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="AyCode.Core">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
</Reference>
<Reference Include="AyCode.Entities">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
</Reference>