Lets say I have this class
public class Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public bool isActive {
Because the new list still contains references to the same employee objects. You can create new ones in a new list by doing something like this:
List Employees = new List();
Employees.Add(new Employee { FirstName = "firstname", LastName = "lastname", isActive = true });
List EmployeesCopy = Employees.Select(x => new Employee(x)).ToList();
public class Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public bool isActive { get; set; }
public Employee()
{ }
public Employee(Employee e)
{
FirstName = e.FirstName;
LastName = e.LastName;
isActive = e.isActive;
}
}