using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MagMan.Data.Tenant.DbModels { // // This is here so CodeMaid doesn't reorganize this document // [Table("MaterialsList")] public partial class MaterialModel { /// /// Init classe /// public MaterialModel() { RawItemList = new HashSet(); } /// /// Primary Key AUTO /// [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int MatId { get; set; } /// /// Codice Materiale /// public string MatCode { get; set; } = ""; /// /// Descrizione materiale /// public string MatDesc { get; set; } = ""; /// /// Height (Thikness/Spessore) in mm /// public decimal HMm { get; set; } = 0; /// /// Lenght/Lunghezza in mm /// public decimal LMm { get; set; } = 0; /// /// Width/Larghezza in mm /// public decimal WMm { get; set; } = 0; /// /// Codice materiale x QR/Datamatrix /// [NotMapped] public string MatDtmx { get => $"MT{MatId:00000000}"; } /// /// Verifica che sia Beam, quando L == 0 /// [NotMapped] public bool IsBeam { get => (LMm == 0 && (HMm > 0 && WMm > 0)); } /// /// Verifica che sia Wall, quando W/L == 0 /// [NotMapped] public bool IsWall { get => (HMm > 0 && (LMm == 0 && WMm == 0)); } /// /// Navigazione ad oggetti child /// public virtual ICollection? RawItemList { get; set; } } }