by ReubenBond

ReubenBond / DeepCopy

Simple & efficient library for deep copying .NET objects

132 Stars 18 Forks Last release: Not found MIT License 23 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


Simple & efficient library for deep copying .NET objects

Described in this blog post:


Install via NuGet:

PM> Install-Package DeepCopy


// Add a using directive for DeepCopy.
var poco = new Poco();
var original = new[] { poco, poco };

var result = DeepCopier.Copy(original);

// The result is a copy of the original. Assert.NotSame(original, result);

// Because both elements in the original array point to the same object, // both elements in the copied array also point to the same object. Assert.Same(result[0], result[1]);

Optionally, classes can be marked using the

attribute to tell
to skip copying them and return them unmodified. Object can also be wrapped in

The majority of this project was adapted from


PR's welcome!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.