using System; namespace Lab18.Models { public class Goods { string g_name; int g_id; public string G_name { get { return g_name; } } public int G_id { get { return g_id; } } public Goods(string g_name, int g_id) { this.g_name = g_name; this.g_id = g_id; } public void Display() { Console.WriteLine("Goods: g_name={0} g_id={1}", g_name, g_id); } //сравнение двух объектов класса Goods на равенство public override bool Equals(object obj) { Goods p = obj as Goods; return ((g_name == p.g_name) && (g_id == p.g_id)); } } }