laatzen/LaaProductionWeb/LaaProductionWeb.Blazor/Components/HeliumTester/Models/ReciepMatchItemModel.cs
2025-03-17 16:03:24 +01:00

31 lines
755 B
C#

namespace LaaProductionWeb.Blazor.Components.HeliumTester.Models
{
using Newtonsoft.Json;
public class ReciepMatchItemModel<T> : MatchItemModel
{
public ReciepMatchItemModel(string key, T value)
{
this.Key = key;
this.Value = value;
}
public ReciepMatchItemModel() { }
public string Key { get; set; }
[JsonIgnore]
public T Value { get; }
public override bool Equals(object other)
=> other is ReciepMatchItemModel<T> x
&& $"{x.Key}" == $"{this.Key}";
public override int GetHashCode()
=> this.Key.GetHashCode();
public override string ToString()
=> this.Value?.ToString();
}
}