ObjectMerger contains 2 projects:
- 1 library project with the ObjectMerger extension methods
- 1 Test project.
To use the ObjectMerger in your own project, you have to make a assembly reference to
When you have done this, you can use this namespace in your class and you will see that a new extension method will appear in your Intellisense box:
. You can use this extension method to merge your object into another object. The
also supports (Generic) Lists, if you have two Lists<of T>, i.e. List<Person> listA and List<Person> listB, these list will be merged by calling listA.MergeWith(listB).
Please download the source code for some examples.
NOTE: When you merge 2 objects of different types, the ObjectMerger will throw an exception