I need to know how to deep clone a List <Business>
object. I tried the following:
List< Business> owner = bus.Select(m => new Business{
Businessname= m.Businessname,
Locations= m.Locations,
}).ToList();
I removed an object (Locations
- Locations is a List <Country>
) from owner
object. I expected no changes in the bus
object as I cloned it as shown in the above code.
However, the object Locations
has also got deleted from the bus
object. Can someone tell me how to fix this ?