# DeepCopier **Repository Path**: brirmb/DeepCopier ## Basic Information - **Project Name**: DeepCopier - **Description**: 因为对表达式树有点兴趣,出于练手的目的,试着写了一个深拷贝的工具库。支持.net standard2.0或.net framework4.5及以上 - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-02 - **Last Updated**: 2024-01-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DeepCopier DeepCopier is a small library that can deep copy object by Expression Tree. ## Installation: Install DeepCopier [NuGet package](https://www.nuget.org/packages/DeepCopier/). ## Usage Examples: ### 1.Deep copy the source object. ```C# SomeType obj1 = new SomeType(); SomeType obj2 = Copier.Copy(obj1); List list1 = new List{ obj1 }; List list2 = Copier.Copy(list1); ``` ### 2.Create a new instance of the target type, and deep copy the property values of the given source object into the target instance. ```C# /* The source and target classes do not have to match or even be derived from each other, as long as the properties match. */ SomeType obj1 = new SomeType(); AnotherType obj2 = Copier.Copy(obj1); ``` ### 3.Copy the property values of the given source object into an existing target object. ```C# /* The source and target classes do not have to match or even be derived from each other, as long as the properties match. */ SomeType obj1 = new SomeType(); AnotherType obj2 = new AnotherType(); Copier.Copy(obj1, obj2); ```