ICloneService Interface
Defines the base requirements for a service which can be used to clone objects.
public interface ICloneService
Methods
CreateClone(object?)
Returns a clone of the original object.
object? CreateClone(object? original)
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
Returns
- object:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone(object?, CloneOptions)
Returns a clone of the original object.
object? CreateClone(object? original, CloneOptions options)
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | CloneOptions | The options to use when cloning. |
Returns
- object:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone<T>(object?)
Returns a clone of the original object.
T? CreateClone<T>(object? original) where T : class
- Type Parameters:
-
T
-The type of the cloned object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
Returns
- T:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone<T>(object?, CloneOptions)
Returns a clone of the original object.
T? CreateClone<T>(object? original, CloneOptions options) where T : class
- Type Parameters:
-
T
-The type of the cloned object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | CloneOptions | The options to use when cloning. |
Returns
- T:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).