PIbd-23_Vrazhkin_S_A_Electr.../lab1/Generics/LocomotivCollectionInfo.cs
2023-12-12 13:58:32 +04:00

22 lines
539 B
C#

namespace ElectricLocomotive;
public class LocomotivCollectionInfo : IEquatable<LocomotivCollectionInfo>
{
public string Name { get; private set; }
public string Description { get; private set; }
public LocomotivCollectionInfo(string name, string description)
{
Name = name;
Description = description;
}
public bool Equals(LocomotivCollectionInfo? other)
{
return Name == other.Name;
}
public override int GetHashCode()
{
return this.Name.GetHashCode();
}
}