using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; namespace Egw.Data.Window { public class Profile { /// /// ID del record /// public int ProfileID { get; set; } /// /// Codice esterno risorsa (opzionale) /// public string Code { get; set; } = string.Empty; /// /// Descrizione /// public string Description { get; set; } = string.Empty; /// /// Spessore del profilo /// public double Thickness { get; set; } = 0; /// /// Versione serializzata info Threshold profilo /// public string ThreshDataRaw { get; set; } = ""; /// /// Lista (ReadOnly) oggetti Threshold deserializzati /// [NotMapped] public List ThresholdList { get { List answ = new List(); if (!string.IsNullOrEmpty(ThreshDataRaw)) { answ = JsonConvert.DeserializeObject>(ThreshDataRaw) ?? new List(); } return answ; } } /// /// Versione serializzata info ProfileData /// public string ProfDataRaw { get; set; } = ""; /// /// Dizionario chiave/valore dei parametri del profilo /// [NotMapped] public Dictionary ProfileDataDict { get { Dictionary answ = new Dictionary(); if (!string.IsNullOrEmpty(ProfDataRaw)) { answ = JsonConvert.DeserializeObject>(ProfDataRaw) ?? new Dictionary(); } return answ; } } } }