Click or drag to resize

CopyContext.CloneIfNotMapped<T> Method

Looks for a mapping for this object that was added with AddObjectMapping<T>(T, T). If one is found, the object to which the specified one is mapped is returned. If one is not found, this method clones the given object by calling Clone<T>(T). Derived classes can override this default behavior.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 25.1.421.0 (25.1.421.0)
Syntax
public virtual T CloneIfNotMapped<T>(
	T oldObject
)
where T : class

Parameters

oldObject
Type: T
The old object reference for which to look for a mapping or clone.

Type Parameters

T
The type of the object to clone.

Return Value

Type: T
The object that the specified object is mapped to, or a cloned object if the specified object was not mapped.
Exceptions
ExceptionCondition
InvalidOperationException The object does not implement ICloneWithContext or ICloneable.
See Also