using System.Collections.Generic; using System.Linq; namespace bdAsegasa.db { public partial class enumeraciones { public string CodigoDescripcion { get { if (string.IsNullOrEmpty(this.Codigo) || !this.Codigo.Contains(".")) { return "- " + this.Descripcion; } var parts = this.Codigo.Split('.'); if (parts.Length > 1) { return parts[1] + " - " + this.Descripcion; } return this.Codigo + " - " + this.Descripcion; } } public int? ValorEntero1 { get { if (this.ValorNumerico1.HasValue) { return (int)this.ValorNumerico1.Value; } else { return null; } } set { if (value.HasValue) { this.ValorNumerico1 = (double)value.Value; } else { this.ValorNumerico1 = null; } } } private static List _LConfsi; public static List LConfsi { get { if (_LConfsi == null) { var bd = tscgestionasegasa.NuevoContexto(); // Assuming NuevoContexto or similar context provider logic is used _LConfsi = bd.enumeraciones.Where(x => x.Codigo != null && x.Codigo.StartsWith("VF.SI-")).OrderByDescending(x => x.Fecha1).ToList(); } return _LConfsi; } } } }