Why foreach(){} doesn't search in first part of a list?
Here is a part of a code: List<Employee> parts = new List<Employee>(); parts.Add(new Employee()); Employee.Make(); parts.Add(new Employee()); Employee.Make(); void Edit() { Console.WriteLine("What do you want to edit? 1 - workers, 2 - Departments."); int answer = int.Parse(Console.ReadLine()); if (answer == 1) { Console.WriteLine("1 - Edit, 2 - Fire"); int workAnswer = int.Parse(Console.ReadLine()); if (workAnswer == 1) { Console.WriteLine("Which one? Enter id or fullname"); var editAnswer = Console.ReadLine(); foreach (Employee empl in parts) { if (editAnswer == Employee.id) { Console.WriteLine("-f