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)]