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:
parent
6d689d3632
commit
18b119c7a8
|
|
@ -1,7 +1,10 @@
|
||||||
using Mango.Nop.Core.Dtos;
|
using Mango.Nop.Core.Dtos;
|
||||||
|
using Nop.Core.Domain.Common;
|
||||||
|
|
||||||
namespace FruitBank.Common.Dtos;
|
namespace FruitBank.Common.Dtos;
|
||||||
|
|
||||||
|
[LinqToDB.Mapping.Table(Name = nameof(GenericAttribute))]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(GenericAttribute))]
|
||||||
public class GenericAttributeDto : MgGenericAttributeDto
|
public class GenericAttributeDto : MgGenericAttributeDto
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace FruitBank.Common.Dtos;
|
namespace FruitBank.Common.Dtos;
|
||||||
|
|
||||||
|
[LinqToDB.Mapping.Table(Name = nameof(Order))]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(Order))]
|
||||||
public class OrderDto : MgOrderDto<OrderItemDto, ProductDto>, IOrderDto
|
public class OrderDto : MgOrderDto<OrderItemDto, ProductDto>, IOrderDto
|
||||||
{
|
{
|
||||||
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace FruitBank.Common.Dtos;
|
namespace FruitBank.Common.Dtos;
|
||||||
|
|
||||||
|
[LinqToDB.Mapping.Table(Name = nameof(OrderItem))]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(OrderItem))]
|
||||||
public class OrderItemDto : MgOrderItemDto<ProductDto>, IOrderItemDto
|
public class OrderItemDto : MgOrderItemDto<ProductDto>, IOrderItemDto
|
||||||
{
|
{
|
||||||
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace FruitBank.Common.Dtos;
|
namespace FruitBank.Common.Dtos;
|
||||||
|
|
||||||
|
[LinqToDB.Mapping.Table(Name = "Product")]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table("Product")]
|
||||||
public class ProductDto : MgProductDto, IProductDto
|
public class ProductDto : MgProductDto, IProductDto
|
||||||
{
|
{
|
||||||
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace FruitBank.Common.Dtos
|
namespace FruitBank.Common.Dtos
|
||||||
{
|
{
|
||||||
|
[LinqToDB.Mapping.Table(Name = nameof(StockQuantityHistory))]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(StockQuantityHistory))]
|
||||||
public class StockQuantityHistoryDto : MgStockQuantityHistoryDto<ProductDto>, IStockQuantityHistoryDto
|
public class StockQuantityHistoryDto : MgStockQuantityHistoryDto<ProductDto>, IStockQuantityHistoryDto
|
||||||
{
|
{
|
||||||
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,13 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Core\AyCode.Core.csproj" />
|
||||||
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
<ProjectReference Include="..\FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj" />
|
<ProjectReference Include="..\FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj" />
|
||||||
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<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">
|
<Reference Include="AyCode.Entities">
|
||||||
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue