namespace LaaProductionWeb.Blazor.Components.HeliumTester.Models { using LaaPackages.Data.HeliumTester; using System; using System.Runtime.CompilerServices; public class HeliumRecipeModel(HeliumRecipe entity = default) { private readonly HeliumRecipe entity = entity ?? new HeliumRecipe(); public event Action PropertyChanged; public event Action RecipeChanged; public virtual int Id => this.entity.Id; public virtual string MatchRegion => this.entity.MatchRegion; public virtual string MatchMeterSize => this.entity.MatchMeterSize; public virtual string MatchBodyLength => this.entity.MatchBodyLength; public virtual string MatchPressureSensor => this.entity.MatchPressureSensor; public virtual int RunTest { get => this.entity.RunTest; set { this.entity.RunTest = value; this.NotifyPropertyChanged(); } } public virtual int HeliumConcentration { get => this.entity.HeliumConcentration; set { this.entity.HeliumConcentration = value; this.NotifyPropertyChanged(); } } public virtual double TargetPressure { get => this.entity.TargetPressure; set { this.entity.TargetPressure = value; this.NotifyPropertyChanged(); } } public virtual double LowerLimitPressure { get => this.entity.LowerLimitPressure; set { this.entity.LowerLimitPressure = value; this.NotifyPropertyChanged(); } } public virtual double UpperLimitPressure { get => this.entity.UpperLimitPressure; set { this.entity.UpperLimitPressure = value; this.NotifyPropertyChanged(); } } public virtual int StabilizationTime { get => this.entity.StabilizationTime; set { this.entity.StabilizationTime = value; this.NotifyPropertyChanged(); } } public virtual int TestTime { get => this.entity.TestTime; set { this.entity.TestTime = value; this.NotifyPropertyChanged(); } } public virtual double LowerLimitLeakRate { get => this.entity.LowerLimitLeakRate; set { this.entity.LowerLimitLeakRate = value; this.NotifyPropertyChanged(); } } public virtual double UpperLimitLeakRate { get => this.entity.UpperLimitLeakRate; set { this.entity.UpperLimitLeakRate = value; this.NotifyPropertyChanged(); } } private void NotifyPropertyChanged([CallerMemberName] string member = default) { this.PropertyChanged?.Invoke(member); this.RecipeChanged?.Invoke(this); } public static HeliumRecipe ToEntity(HeliumRecipeModel model) => model.entity; public static HeliumRecipeModel ToModel(HeliumRecipe entity) => new (entity); } }