using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using SteUp.Shared.Core.Dto; namespace SteUp.Shared.Core.Entities; public class Scheda : EntityBase { [Key] public int Id { get; set; } public string? CodJfas { get; set; } [Required] public string CodMdep { get; set; } = string.Empty; public DateOnly Data { get; set; } [Required] public string Rilevatore { get; set; } = string.Empty; public Ispezione? Ispezione { get; set; } public string? DescrizioneReparto { get; set; } public string? ActivityTypeId { get; set; } public string? Note { get; set; } public string? Responsabile { get; set; } public int Scadenza { get; set; } = 1460; [NotMapped] public JtbFasiDto? Reparto { get { if (field == null && CodJfas != null) { field = new JtbFasiDto { CodJfas = CodJfas, Descrizione = DescrizioneReparto }; } return field; } set { field = value; if (value == null) return; CodJfas = value.CodJfas; DescrizioneReparto = value.Descrizione; } } }