public static T DeepClone<T>(
this T obj,
Func<Object, Object?>? customClone = null
)
<ExtensionAttribute>
Public Shared Function DeepClone(Of T) (
obj As T,
Optional customClone As Func(Of Object, Object) = Nothing
) As T
public:
[ExtensionAttribute]
generic<typename T>
static T DeepClone(
T obj,
Func<Object^, Object^>^ customClone = nullptr
)
[<ExtensionAttribute>]
static member DeepClone :
obj : 'T *
?customClone : Func<Object, Object>
(* Defaults:
let _customClone = defaultArg customClone null
*)
-> 'T
If customClone is , then this method returns a functionally equivalent clone of the original object.
String, Delegate and runtime Type instances are not cloned but their original reference is returned in the result. This can be overridden by handling these types in customClone.