using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ODCWeb.Models { public class FloorAction { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ActionId { get; set; } public string Name { get; set; } /* */ [Display(Name = "Display Action Name")] public string? DisplayNameA { get; set; } // This computed property will return DisplayName if not null, otherwise Name [NotMapped] // This prevents EF Core from trying to map this to a database column public string EffectiveDisplayNameA => DisplayNameA ?? Name; /* */ public int FloorId { get; set; } [ValidateNever] public Floor Floor { get; set; } public double? A_Material_Cost { get; set; } } }