How to remove duplicates from a list in C#? - Biz Tech

How to remove duplicates from a list in C#?

Listen
List<int> numbers = new List<int> { 1, 5, 2, 7, 3, 5, 1 };
List<int> distinctNumbers = numbers.Distinct().ToList();

foreach (int number in distinctNumbers)
{
    Console.WriteLine(number);
}