Click or drag to resize

CopyContextCloneIfNotMappedT Method

Looks for a mapping for this object that was added with AddObjectMappingT(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 CloneT(T). Derived classes can override this default behavior.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 20.3.405.0 (20.3.405.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