Skip to content
JulianR edited this page Aug 21, 2011 · 1 revision

Making a clone is as easy as creating a map where the source type is the same as the destination type, or by calling DeepClone on the mapper and supplying the source object.

Depth

By default, cloning depth is limited to a depth of 2. Meaning the source object will be cloned, its properties and the properties of those properties. You can change this by setting the option 'mapper.Options.Conventions.MaxCloneDepth'. Setting this to null removes the limit and the entirety of the object graph will be cloned. This may however result in excessively large mapping code though and is generally not recommended. Setting it to any number will limit the depth to that number.

Recursion

ThisMember will detect recursion and stop recursing deeper when it does.

Clone this wiki locally