53
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
5
namespace ConsoleApplication1
6
{
7
internal class Student
8
{
9
public int ID { get; set; }
10
public string Name { get; set; }
11
}
12
13
internal class StudentNameComparer : IEqualityComparer<Student>
14
{
15
public bool Equals(Student x, Student y)
16
{
17
if (string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase))
18
{
19
return true;
20
}
21
return false;
22
}
23
24
public int GetHashCode(Student obj)
Cached Result
Player1
Player2
PLayer3
Player2
PLayer3