using Model; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection.Emit; using System.Text; using System.Threading.Tasks; namespace ConsoleApp.Menu { internal class Selector : IEquatable> where T : notnull { private string _line = ""; public string Line { get => _line; private set { if (string.IsNullOrEmpty(value)) _line = "no data"; else _line = value; } } public T Item { get; private set; } public Selector(T item, string line = "") { Line = line; Item = item; } public virtual bool Equals(Selector? other) { if (other == null) return false; if (other == this) return true; return other.Line.Equals(this.Line); } public override bool Equals(object? obj) { var item = obj as Selector; if (item == null) return false; return Equals(obj); } public override int GetHashCode() { return Line.GetHashCode(); } } }