DeepCopy 1.0.0

Simple and efficient library for deep copying .NET objects

There is a newer version of this package available.
See the version list below for details.
Install-Package DeepCopy -Version 1.0.0
dotnet add package DeepCopy --version 1.0.0
<PackageReference Include="DeepCopy" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeepCopy --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DeepCopy

Simple &amp; efficient library for deep copying .NET objects

Installation:

Install via NuGet:

PM> Install-Package DeepCopy

Usage:

// 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 [Immutable] attribute to tell DeepCopy to skip copying them and return them unmodified.
Object can also be wrapped in Immutable&lt;T&gt; using Immutable.Create(value).

The majority of this project was adapted from dotnet/orleans.

PR's welcome!

DeepCopy

Simple &amp; efficient library for deep copying .NET objects

Installation:

Install via NuGet:

PM> Install-Package DeepCopy

Usage:

// 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 [Immutable] attribute to tell DeepCopy to skip copying them and return them unmodified.
Object can also be wrapped in Immutable&lt;T&gt; using Immutable.Create(value).

The majority of this project was adapted from dotnet/orleans.

PR's welcome!

Version History

Version Downloads Last updated
1.0.3 5,808 12/5/2017
1.0.2 244 11/8/2017
1.0.1 215 11/5/2017
1.0.0 249 11/4/2017