From e54612f923a108e6dc9015ce9cd1cd7c1f9ff409 Mon Sep 17 00:00:00 2001 From: Loretta Date: Sun, 19 Oct 2025 15:08:02 +0200 Subject: [PATCH] ShippingDocumentToFiles fix; --- FruitBank.Common/DocumentType.cs | 2 +- .../Entities/ShippingDocumentToFiles.cs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/FruitBank.Common/DocumentType.cs b/FruitBank.Common/DocumentType.cs index f765e87..25bda5b 100644 --- a/FruitBank.Common/DocumentType.cs +++ b/FruitBank.Common/DocumentType.cs @@ -1,6 +1,6 @@ namespace FruitBank.Common; -public enum DocumentType : byte +public enum DocumentType : int { NotSet = 0, Unknown = 5, diff --git a/FruitBank.Common/Entities/ShippingDocumentToFiles.cs b/FruitBank.Common/Entities/ShippingDocumentToFiles.cs index d89574f..a85c245 100644 --- a/FruitBank.Common/Entities/ShippingDocumentToFiles.cs +++ b/FruitBank.Common/Entities/ShippingDocumentToFiles.cs @@ -1,16 +1,25 @@ -using FruitBank.Common.Interfaces; +using System.ComponentModel.DataAnnotations.Schema; +using FruitBank.Common.Interfaces; using LinqToDB.Mapping; using Mango.Nop.Core.Entities; namespace FruitBank.Common.Entities; -[Table(Name = FruitBankConstClient.ShippingDocumentToFilesDbTableName)] +[LinqToDB.Mapping.Table(Name = FruitBankConstClient.ShippingDocumentToFilesDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentToFilesDbTableName)] public class ShippingDocumentToFiles : MgEntityBase, IShippingDocumentToFiles { public int FilesId { get; set; } public int ShippingDocumentId { get; set; } - public DocumentType DocumentType { get; set; } + + public int DocumentTypeId { get; set; } + + [NotColumn, NotMapped] + public DocumentType DocumentType + { + get => (DocumentType)DocumentTypeId; + set => DocumentTypeId = (int)value; + } [Association(ThisKey = nameof(FilesId), OtherKey = nameof(Files.Id), CanBeNull = true)]