CommonNetFuncs.DeepClone 3.6.19

There is a newer version of this package available.
See the version list below for details.
dotnet add package CommonNetFuncs.DeepClone --version 3.6.19
                    
NuGet\Install-Package CommonNetFuncs.DeepClone -Version 3.6.19
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommonNetFuncs.DeepClone" Version="3.6.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommonNetFuncs.DeepClone" Version="3.6.19" />
                    
Directory.Packages.props
<PackageReference Include="CommonNetFuncs.DeepClone" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommonNetFuncs.DeepClone --version 3.6.19
                    
#r "nuget: CommonNetFuncs.DeepClone, 3.6.19"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CommonNetFuncs.DeepClone@3.6.19
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommonNetFuncs.DeepClone&version=3.6.19
                    
Install as a Cake Addin
#tool nuget:?package=CommonNetFuncs.DeepClone&version=3.6.19
                    
Install as a Cake Tool

CommonNetFuncs.DeepClone

nuget

This project contains helper methods for deep cloning objects in .NET applications (i.e. creating a new instance of an object with the same values as an existing instance but without the same references in memory).

Contents


ExpressionTrees

Use expression trees to deep clone objects. This is by far the fastest of the three deep clone methods in this package with a minor penalty for the first clone of each unique type to construct the expression tree.

ExpressionTrees Usage Examples

<details> <summary><h3>Usage Examples</h3></summary>

DeepClone

Deep clone an object using expression trees.

public class Person
{
  public string Name { get; set; }
  public int Age { get; set; }
}

Person original = new() { Name = "Chris", Age = "34" };
Person clone = original.DeepClone();
clone.Name = "Nick"; // Clone's Name property == "Nick" while original's Name property remains "Chris"

</details>


Reflection

Use reflection to deep clone objects. In most cases this is the second fastest option of the three deep clone methods in this package.

Reflection Usage Examples

<details> <summary><h3>Usage Examples</h3></summary>

DeepCloneR

Deep clone an object using reflection.

public class Person
{
  public string Name { get; set; }
  public int Age { get; set; }
}

Person original = new() { Name = "Chris", Age = "34" };
Person clone = original.DeepCloneR();
clone.Name = "Nick"; // Clone's Name property == "Nick" while original's Name property remains "Chris"

</details>


Serialize

Use JSON serialization to deep clone objects. In most cases this is the slowest option of the three deep clone methods in this package.

Serialize Usage Examples

<details> <summary><h3>Usage Examples</h3></summary>

DeepCloneS

Deep clone an object using JSON serialization.

public class Person
{
  public string Name { get; set; }
  public int Age { get; set; }
}

Person original = new() { Name = "Chris", Age = "34" };
Person clone = original.DeepCloneS();
clone.Name = "Nick"; // Clone's Name property == "Nick" while original's Name property remains "Chris"

</details>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CommonNetFuncs.DeepClone:

Package Downloads
CommonNetFuncs.Web.Api

Generic API endpoints for use in an ASP.NET API

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.7.13 44 9/8/2025
3.7.0 186 8/18/2025
3.6.27 131 8/18/2025
3.6.26 138 8/14/2025
3.6.25 143 8/13/2025
3.6.24 143 8/12/2025
3.6.19 142 7/28/2025
3.6.18 326 7/25/2025
3.6.1 150 7/14/2025
3.6.0 112 7/11/2025
3.5.3 148 7/10/2025
3.5.0 154 7/7/2025
3.4.30 130 7/7/2025
3.4.23 161 6/26/2025
3.4.21 147 6/26/2025
3.4.20 161 6/25/2025
3.4.8 361 6/11/2025
3.4.2 167 6/2/2025
3.4.1 103 5/30/2025
3.4.0 113 5/30/2025
3.3.11 156 5/19/2025
3.3.10 279 5/13/2025
3.3.0 194 4/29/2025
3.2.22 294 3/12/2025
3.2.13 207 2/13/2025
3.2.0 187 12/19/2024
3.1.0 202 12/6/2024
3.0.0 151 12/3/2024
2.1.3 138 12/3/2024
2.1.0 140 12/2/2024
2.0.5 133 11/26/2024
2.0.2 144 11/18/2024
2.0.1 124 11/15/2024
2.0.0 135 11/14/2024
1.0.47 150 11/14/2024
1.0.42 168 11/12/2024
1.0.40 153 11/12/2024
1.0.37 168 11/4/2024
1.0.31 160 10/31/2024
1.0.28 161 10/25/2024
1.0.26 185 10/18/2024
1.0.25 135 10/17/2024
1.0.24 116 10/17/2024
1.0.18 153 10/11/2024
1.0.17 173 9/27/2024
1.0.16 140 9/27/2024
1.0.14 153 9/23/2024
1.0.13 148 9/18/2024
1.0.12 139 9/18/2024
1.0.11 145 9/18/2024
1.0.10 189 9/11/2024
1.0.9 183 9/11/2024
1.0.8 173 9/11/2024
1.0.7 183 9/11/2024
1.0.1 180 9/4/2024
1.0.0 171 9/2/2024