Class DeepCloneHelper
Provides helper methods for deep cloning objects.
Inheritance
object
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public static class DeepCloneHelper
Methods
View SourceCloneListItems<TList, TEntity>(TList, TList)
Clones list items from a source collection to a target collection.
Declaration
public static void CloneListItems<TList, TEntity>(TList source, TList target) where TList : ICollection<TEntity>
Parameters
| Type | Name | Description |
|---|---|---|
| TList | source | The source collection to clone from. |
| TList | target | The target collection to clone to. |
Type Parameters
| Name | Description |
|---|---|
| TList | The type of collection. |
| TEntity | The type of entity in the collection. |
DeepCloneRefProperties(IDeepCloneable, IDeepCloneable)
Used to deep clone any reference properties on the object (should be done after a MemberwiseClone for which the outcome is 'output')
Declaration
public static void DeepCloneRefProperties(IDeepCloneable input, IDeepCloneable output)
Parameters
| Type | Name | Description |
|---|---|---|
| IDeepCloneable | input | |
| IDeepCloneable | output |