C# 9 records and with expressions can make it a little easier, especially if your type has many properties.
You can use something like:
var books2 = books1.Select(b => b with { }).ToList();
I did this as an example:
record Book
{
public string Name { get; set; }
}
static void Main()
{
List<Book> books1 = new List<Book>()
{
new Book { Name = "Book1.1" },
new Book { Name = "Book1.2" },
new Book { Name = "Book1.3" }
};
var books2 = books1.Select(b => b with { }).ToList();
books2[0].Name = "Changed";
books2[1].Name = "Changed";
Console.WriteLine("Book1");
foreach (var item in books1)
{
Console.WriteLine(item);
}
Console.WriteLine("Book2");
foreach (var item in books2)
{
Console.WriteLine(item);
}
}
And the result was:
Book1
Book { Name = Book1.1 }
Book { Name = Book1.2 }
Book { Name = Book1.3 }
Book2
Book { Name = Changed }
Book { Name = Changed }
Book { Name = Book1.3 }